Re: rrdtool::graph and German weekday names

Heinrich Schnorrenberg <[email protected]> Thu, 2 Nov 2017 23:38:45 +0100
Newsgroups gmane.comp.db.rrdtool.user
Message-ID <[email protected]>
--===============6631636476707528213==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_D7D66A13-79CE-4C95-8928-729E3F5AB146"


--Apple-Mail=_D7D66A13-79CE-4C95-8928-729E3F5AB146
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hi Jochen


I just checked it on my raspi . here it works.  the script is :
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++

 #!/usr/bin/perl -w
#
use warnings;
use POSIX qw(locale_h);
use locale;
use POSIX qw(strftime);


#
for (1..7) {
   $wochentag[$_] =3D strftime("%a", 0, 0, 0, $_, 3, 96);
   printf "$wochentag[$_]\n";
}

> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
the output is:

pi@raspberrypi:~/public_html/cgi-bin $ perl loc.pl
Mo
Di
Mi
Do
Fr
Sa
So

hope that helps

regards Heinrich



> On 2. Nov 2017, at 11:02, Joachim Hartmann =
<[email protected]> wrote:
>=20
> Hi Tobi,
> Am 01.11.2017 um 20:19 schrieb Tobias Oetiker:
>> Hi Joachim,
>> Tobias Oetiker
>=20
>> I would suggest to use
>> use POSIXqw(locale_h);
>> use locale;
>> setlocale(LC_CTYPE,"de_DE.UTF-8");
>> INSIDE the script
>> More details on this to be found here =
https://perldoc.perl.org/perllocale.html
>> Cheers
>> Tobi
>=20
> the proposed solution shows no change. I then looked at the =
recommended web page and ran the following script on the command line:
>=20
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> #!/usr/bin/perl=EF=BB=BF
> use POSIX qw(strftime);
>=20
> for (1..7) {
>    $wochentag[$_] =3D strftime("%a", 0, 0, 0, $_, 3, 96);
>    printf "$wochentag[$_]\n";
> }
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>=20
> Here is the result:
>=20
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> #~#. /test_locale. pl
> Mo
> Di
> Wed
> Thu
> Fr
> Sa
> So
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>=20
> I think now rather that the solution can be found in rrdtool (1.6.0).
> --=20
> Cheers
> Jochen
>=20
> _______________________________________________
> rrd-users mailing list
> [email protected]
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


--Apple-Mail=_D7D66A13-79CE-4C95-8928-729E3F5AB146
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Hi =
Jochen<div class=3D""><br class=3D""><div class=3D"">
<div style=3D"color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
18px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px;"><br class=3D""></div><div style=3D"color:=
 rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">I =
just checked it on my raspi . here it works. &nbsp;the script is =
:</div><div style=3D"color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 18px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px;"><blockquote type=3D"cite" =
class=3D"">++++++++++++++++++++++++++++++++++++++++++++++++++++++</blockqu=
ote></div><div style=3D"color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 18px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px;">&nbsp;<span style=3D"color: rgb(52, =
188, 38); font-family: Menlo; background-color: rgb(255, 255, 255);" =
class=3D"">#!/usr/bin/perl -w</span></div><div style=3D"margin: 0px; =
font-stretch: normal; line-height: normal; font-family: Menlo; color: =
rgb(52, 188, 38); background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">#</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; color: rgb(204, 204, =
204); background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">use =
warnings;</span></div><div style=3D"margin: 0px; font-stretch: normal; =
line-height: normal; font-family: Menlo; color: rgb(204, 204, 204); =
background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">use =
POSIX qw(locale_h);</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; color: rgb(204, 204, =
204); background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">use =
locale;</span></div><div style=3D"margin: 0px; font-stretch: normal; =
line-height: normal; font-family: Menlo; color: rgb(204, 204, 204); =
background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">use =
POSIX qw(strftime);</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; background-color: =
rgb(255, 255, 255); min-height: 21px;" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D""></span><br class=3D""></div><div style=3D"margin: 0px; =
font-stretch: normal; line-height: normal; font-family: Menlo; =
background-color: rgb(255, 255, 255); min-height: 21px;" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D""></span><br class=3D""></div><div style=3D"margin: 0px; =
font-stretch: normal; line-height: normal; font-family: Menlo; color: =
rgb(52, 188, 38); background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">#</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; background-color: =
rgb(255, 255, 255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures; color: #d53bd3" class=3D"">for</span><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""> (1..7) =
{</span></div><div style=3D"margin: 0px; font-stretch: normal; =
line-height: normal; font-family: Menlo; background-color: rgb(255, 255, =
255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">&nbsp;&nbsp; </span><span =
style=3D"font-variant-ligatures: no-common-ligatures; color: #33bbc8" =
class=3D"">$wochentag[$_]</span><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D""> =3D strftime(</span><span =
style=3D"font-variant-ligatures: no-common-ligatures; color: #afad24" =
class=3D"">"%a"</span><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">, 0, 0, 0, </span><span =
style=3D"font-variant-ligatures: no-common-ligatures; color: #33bbc8" =
class=3D"">$_,</span><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D""> 3, 96);</span></div><div style=3D"margin:=
 0px; font-stretch: normal; line-height: normal; font-family: Menlo; =
color: rgb(175, 173, 36); background-color: rgb(255, 255, 255);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures; =
color: #000000" class=3D"">&nbsp;&nbsp; </span><span =
style=3D"font-variant-ligatures: no-common-ligatures; color: #c33720" =
class=3D"">printf</span><span style=3D"font-variant-ligatures: =
no-common-ligatures; color: #000000" class=3D""> </span><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">"$wochentag[$_]\n"</span><span style=3D"font-variant-ligatures:=
 no-common-ligatures; color: #000000" class=3D"">;</span></div><div =
style=3D"margin: 0px; font-stretch: normal; line-height: normal; =
font-family: Menlo; background-color: rgb(255, 255, 255);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">}</span></div><div class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""><br =
class=3D""></span></div><div style=3D"color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 18px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px;"><blockquote type=3D"cite" =
class=3D"">++++++++++++++++++++++++++++++++++++++++++++++++++++++</blockqu=
ote>the output is:</div><div style=3D"color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 18px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px;"><br class=3D""></div><div style=3D"color:=
 rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: =
0px;"><div style=3D"margin: 0px; font-stretch: normal; line-height: =
normal; font-family: Menlo; color: rgb(82, 48, 225); background-color: =
rgb(255, 255, 255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures; color: #34bc26" class=3D""><b =
class=3D"">pi@raspberrypi</b></span><span style=3D"font-variant-ligatures:=
 no-common-ligatures; color: #000000" class=3D"">:</span><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""><b =
class=3D"">~/public_html/cgi-bin $</b></span><span =
style=3D"font-variant-ligatures: no-common-ligatures; color: #000000" =
class=3D""> perl loc.pl</span></div><div style=3D"margin: 0px; =
font-stretch: normal; line-height: normal; font-family: Menlo; =
background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">Mo</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; background-color: =
rgb(255, 255, 255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">Di</span></div><div style=3D"margin: =
0px; font-stretch: normal; line-height: normal; font-family: Menlo; =
background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">Mi</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; background-color: =
rgb(255, 255, 255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">Do</span></div><div style=3D"margin: =
0px; font-stretch: normal; line-height: normal; font-family: Menlo; =
background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">Fr</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; background-color: =
rgb(255, 255, 255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">Sa</span></div><div style=3D"margin: =
0px; font-stretch: normal; line-height: normal; font-family: Menlo; =
background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">So</span></div><div style=3D"margin: 0px; font-stretch: =
normal; line-height: normal; font-family: Menlo; background-color: =
rgb(255, 255, 255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D""><br class=3D""></span></div><div =
style=3D"margin: 0px; font-stretch: normal; line-height: normal; =
font-family: Menlo; background-color: rgb(255, 255, 255);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">hope that helps</span></div><div style=3D"margin: 0px; =
font-stretch: normal; line-height: normal; font-family: Menlo; =
background-color: rgb(255, 255, 255);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""><br =
class=3D""></span></div><div style=3D"margin: 0px; font-stretch: normal; =
line-height: normal; font-family: Menlo; background-color: rgb(255, 255, =
255);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">regards Heinrich</span></div></div><div =
style=3D"color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px;" class=3D""><br class=3D""></div><br =
class=3D"Apple-interchange-newline">
</div>
<div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 2. Nov 2017, at 11:02, Joachim Hartmann &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">Hi =
Tobi,<br class=3D"">Am 01.11.2017 um 20:19 schrieb Tobias Oetiker:<br =
class=3D""><blockquote type=3D"cite" class=3D"">Hi Joachim,<br =
class=3D"">Tobias Oetiker<br class=3D""></blockquote><br =
class=3D""><blockquote type=3D"cite" class=3D"">I would suggest to =
use<br class=3D"">use POSIXqw(locale_h);<br class=3D"">use locale;<br =
class=3D"">setlocale(LC_CTYPE,"de_DE.UTF-8");<br class=3D"">INSIDE the =
script<br class=3D"">More details on this to be found here <a =
href=3D"https://perldoc.perl.org/perllocale.html" =
class=3D"">https://perldoc.perl.org/perllocale.html</a><br =
class=3D"">Cheers<br class=3D"">Tobi<br class=3D""></blockquote><br =
class=3D"">the proposed solution shows no change. I then looked at the =
recommended web page and ran the following script on the command =
line:<br class=3D""><br =
class=3D"">++++++++++++++++++++++++++++++++++++++++++++++++++++++<br =
class=3D"">#!/usr/bin/perl=EF=BB=BF<br class=3D"">use POSIX =
qw(strftime);<br class=3D""><br class=3D"">for (1..7) {<br class=3D""> =
&nbsp;&nbsp;&nbsp;$wochentag[$_] =3D strftime("%a", 0, 0, 0, $_, 3, =
96);<br class=3D""> &nbsp;&nbsp;&nbsp;printf "$wochentag[$_]\n";<br =
class=3D"">}<br =
class=3D"">++++++++++++++++++++++++++++++++++++++++++++++++++++++<br =
class=3D""><br class=3D"">Here is the result:<br class=3D""><br =
class=3D"">++++++++++++++++++++++++++++++++++++++++++++++++++++++<br =
class=3D"">#~#. /test_locale. pl<br class=3D"">Mo<br class=3D"">Di<br =
class=3D"">Wed<br class=3D"">Thu<br class=3D"">Fr<br class=3D"">Sa<br =
class=3D"">So<br =
class=3D"">++++++++++++++++++++++++++++++++++++++++++++++++++++++<br =
class=3D""><br class=3D"">I think now rather that the solution can be =
found in rrdtool (1.6.0).<br class=3D"">-- <br class=3D"">Cheers<br =
class=3D"">Jochen<br class=3D""><br =
class=3D"">_______________________________________________<br =
class=3D"">rrd-users mailing list<br class=3D""><a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a><br =
class=3D"">https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users<br =
class=3D""></div></div></blockquote></div><br =
class=3D""></div></body></html>=

--Apple-Mail=_D7D66A13-79CE-4C95-8928-729E3F5AB146--


--===============6631636476707528213==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
rrd-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

--===============6631636476707528213==--