Opened 9 years ago

Closed 9 years ago

#9018 closed defect (Fixed)

MythWeather locale issue with yrnoxml.pl

Reported by: rune.evjen@… Owned by: beirdo
Priority: minor Milestone: 0.24
Component: Plugin - MythWeather Version: Master Head
Severity: medium Keywords: mythweather locale yrnoxml.pl yr
Cc: Ticket locked: no

Description

When using the Norwegian yr.no weather data provider, there seems to be some UTF-8/ISO-8859-1 encoding problems for Norwegian æøå letters.

A small perl test:

use POSIX qw(strftime);
print strftime "%a %b %e %H:%M:%S %Y", localtime;

works fine, and gives a UTF-8 display of the date: sø. sep. 26 21:53:30 2010.

But in mythweather and when running the yrnoxml.pl script the date is shown like this:

..
date-0::ma. sep. 27, 2010 12:00:00
date-1::ti. sep. 28, 2010 12:00:00
date-2::on. sep. 29, 2010 14:00:00
date-3::to. sep. 30, 2010 14:00:00
date-4::fr. okt.  1, 2010 14:00:00
date-5::lø. okt.  2, 2010 14:00:00
..
observation_time::sø. sep. 26, 2010 19:15:00
...

If I convert the output from yrnoxml.pl from ISO-8859-1 to UTF-8 using iconv -f ISO-8859-1 -t UTF-8 <yrnoxml-output> the norwegian letters are displayed fine.

yrnoxml.pl output when I run from a terminal is attached to this ticket.

My user locale is set to:

rune@server:~$ locale
LANG=nb_NO.utf8
LANGUAGE=nb:nb_NO:en_US:en
LC_CTYPE="nb_NO.utf8"
LC_NUMERIC="nb_NO.utf8"
LC_TIME="nb_NO.utf8"
LC_COLLATE="nb_NO.utf8"
LC_MONETARY="nb_NO.utf8"
LC_MESSAGES="nb_NO.utf8"
LC_PAPER="nb_NO.utf8"
LC_NAME="nb_NO.utf8"
LC_ADDRESS="nb_NO.utf8"
LC_TELEPHONE="nb_NO.utf8"
LC_MEASUREMENT="nb_NO.utf8"
LC_IDENTIFICATION="nb_NO.utf8"
LC_ALL=nb_NO.utf8

mythfrontend --version

Please attach all output as a file in bug reports.
MythTV Version   : 26520
MythTV Branch    : trunk
Network Protocol : 63
Library API      : 0.23.20100917-1
QT Version       : 4.6.2
Options compiled in:
 linux debug using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_dvb using_firewire using_frontend using_hdhomerun using_hdpvr using_iptv using_ivtv using_joystick_menu using_lirc using_mheg using_opengl_video using_opengl_vsync using_qtdbus using_qtwebkit using_v4l using_x11 using_xrandr using_xv using_xvmc using_xvmc_vld using_xvmcw using_bindings_perl using_bindings_python using_mythtranscode using_opengl using_vdpau using_ffmpeg_threads using_live using_mheg

Attachments (1)

yrnoxml-output (1.3 KB) - added by anonymous 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by anonymous

Attachment: yrnoxml-output added

comment:1 Changed 9 years ago by beirdo

Status: newaccepted

comment:2 Changed 9 years ago by beirdo

Milestone: unknown0.24

comment:3 Changed 9 years ago by beirdo

Resolution: Fixed
Status: acceptedclosed

(In [26740]) Properly support UTF-8 in strings internally in the weather scraper scripts. UTF-8 and perl can be quite a chore at times. This has been tested with the use of LC_ALL=no_NB.utf8 as in the bug report.

Fixes #9018.

Note: See TracTickets for help on using tickets.