<div class="gmail_quote">On Sun, Sep 26, 2010 at 1:03 PM, Rune Evjen <span dir="ltr"><<a href="mailto:rune.evjen@gmail.com">rune.evjen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
When using the Norwegian <a href="http://yr.no" target="_blank">yr.no</a> weather data provider in current trunk,<br>
I get what seems to be some UTF-8/ISO-8859-1 encoding problems for<br>
Norwegian æøå letters.<br>
<br>
It seems that the function 'format_date' in<br>
'/usr/share/mythtv/mythweather/scripts/no_yrno/<a href="http://yrnoxml.pl" target="_blank">yrnoxml.pl</a>' returns<br>
no-UTF8 character, even if the locale is/should be correctly set.<br>
<br>
The small perl test:<br>
<br>
use POSIX qw(strftime);<br>
print strftime "%a %b %e %H:%M:%S %Y", localtime;<br>
<br>
works fine, and gives a UTF-8 display of the date: sø. sep. 26 21:53:30 2010.<br>
<br>
But in mythtv and when running the <a href="http://yrnoxml.pl" target="_blank">yrnoxml.pl</a> script the date is shown<br>
like this:<br>
<br>
..<br>
date-0::ma. sep. 27, 2010 12:00:00<br>
date-1::ti. sep. 28, 2010 12:00:00<br>
date-2::on. sep. 29, 2010 14:00:00<br>
date-3::to. sep. 30, 2010 14:00:00<br>
date-4::fr. okt. 1, 2010 14:00:00<br>
date-5::lø. okt. 2, 2010 14:00:00<br>
..<br>
observation_time::sø. sep. 26, 2010 19:15:00<br>
...<br>
Based on my very limited perl understanding the above output is<br>
created using the 'format_date' function, which uses strftime to<br>
convert the raw data to the date format in the script output, in more<br>
or less the same way as my test script which has a correct output.<br>
<br>
If I convert the output from <a href="http://yrnoxml.pl" target="_blank">yrnoxml.pl</a> from ISO-8859-1 to UTF-8 using<br>
iconv -f ISO-8859-1 -t UTF-8 <yrnoxml-output> the norwegian letters<br>
are displayed fine.<br>
<br>
My user locale is set to:<br>
rune@server:~$ locale<br>
LANG=nb_NO.utf8<br>
LANGUAGE=nb:nb_NO:en_US:en<br>
LC_CTYPE="nb_NO.utf8"<br>
LC_NUMERIC="nb_NO.utf8"<br>
LC_TIME="nb_NO.utf8"<br>
LC_COLLATE="nb_NO.utf8"<br>
LC_MONETARY="nb_NO.utf8"<br>
LC_MESSAGES="nb_NO.utf8"<br>
LC_PAPER="nb_NO.utf8"<br>
LC_NAME="nb_NO.utf8"<br>
LC_ADDRESS="nb_NO.utf8"<br>
LC_TELEPHONE="nb_NO.utf8"<br>
LC_MEASUREMENT="nb_NO.utf8"<br>
LC_IDENTIFICATION="nb_NO.utf8"<br>
LC_ALL=<br>
<br>
Has anyone seen this before ? Is this a locale configuration issue ?<br><br></blockquote><div><br></div><div>Pretty sure this is a script bug. Please put in a ticket and I'll look into it. </div></div>