From: Mattia B. \<mattia\.barbon\@libero\.it\> <mat...@li...> - 2006-10-19 17:40:15
|
Hi, > I have a program written for wxPerl which is meant to display utf8 > strings in a wxTextCtrl control. (The utf8 strings are read from file) > > 1. On Windows, I get illegible garbage. > > 2. On Fedora 5 with LANG set to en_US.UTF-8 the results are fine. > > 3. On Fedora 5 with LANG set to C, lines which contain non-Latin letter= s > are not shown. > > Does someone have a solution to display utf correctly on Windows? Open the file with :utf8 layer. open my $fh, '<:utf8', "C:\my\file"; this should also fix the problems when LANG is set to C. > And what is the explanation as to why lines containing non-Latin > characters do not display at all with LANG set to C? The reason is: when wxPerl receives a Perl string marked as characters, it treats the contents as Unicode; when the string is marked as bytes, it interprets it using the currently set locale. Regards Mattia =0A=0A=0A------------------------------------------------------=0AFino al= 30% di risparmio + sconto extra del 10%. Scopri Direct Line con il preve= ntivo gratuito, entro il 31 Ottobre!=0Ahttp://click.libero.it/direct_line= 7=0A |