Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Encoding problems

by Nik (Initiate)
on May 17, 2006 at 21:53 UTC ( [id://550103]=note: print w/replies, xml ) Need Help??


in reply to Re: Encoding problems
in thread Encoding problems

Here si the code that procudes and fills the contents of the drop down menu:
my @files = <../data/text/*.txt>; my @display_files = map /([^\/]+)\.txt/, @files; print br; print start_form( action=>'index.pl' ); print h1( {class=>'lime'}, "&#917;&#960;&#941;&#955;&#949;&#958;&# +949; &#964;&#959; &#954;&#949;&#943;&#956;&#949;&#957;&#959; &#960;&# +959;&#965; &#963;&#949; &#949;&#957;&#948;&#953;&#945;&#966;&#941;&#9 +61;&#949;&#953; => ", popup_menu( -name=>'select', -values=> +\@display_files ), submit('&#917;&#956;&#966;&#940;&#957; +&#953;&#963;&#951;'));
As Ani from efnet told me maybe the OS i use (xp from MicroSuck) is so damn persisting on creating utf-8 file contents buu saving the filenames as iso-8859-7 instead!!!
What do you think folks?

Replies are listed 'Best First'.
Re^3: Encoding problems
by samtregar (Abbot) on May 17, 2006 at 21:58 UTC
    Are you sure the rest of the data on your page is really UTF-8? Those "&#XXX" things you're outputting are HTML entities, NOT UTF-8.

    Also, what version of Perl are you using?

    -sam

      I think his browser convert his characters into HTML entities when he copied and pasted them into here. samtregar's observations make no sense if the OP had outputed entities.
        Yeah, you're probably right. That samtregar guy sure is smart - I should listen to him more often.

        -sam

Re^3: Encoding problems
by samtregar (Abbot) on May 17, 2006 at 22:03 UTC
    Actually, looking closer, I think your friend is right. If I tell Firefox to interpret the page as "Greek ISO-8859-7" then the select box looks a lot like a list of Greek words. I can't read Greek so it's hard to know for sure!

    Try using something like Unicode::Map8 (old-school) or Encode (new-school) to go from ISO-8859-7 to UTF-8.

    -sam

      Yes if you view it from broswer as freek its lloks fine but then all other tetxt looks reversed. :)
      Is there a way to convert to utf-8 all my greek .txt filenames? a utility perhaps?

      Can you please suggest me how i should do this encodign change you described? Thank you
        Yes - I already pointed out two modules you can use: Unicode::Map8 and Encode. I'd use Unicode::Map8 personally, since I've used it before. Encode is newer and I've heard people say it's better, but I've never used it myself.

        Give it a try after reading the documentation. If you run into trouble post a new question about it here.

        -sam

        A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://550103]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found