Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: files saved in unicode are not being read correctly

by Courage (Parson)
on Jun 30, 2002 at 12:30 UTC ( #178357=note: print w/replies, xml ) Need Help??

in reply to files saved in unicode are not being read correctly

If you want to use new feature of perl-5.8.0 and to read directly unicode data, you should tell to perl that your file is Unicode:
open(my $fh,'<:utf8', 'anything'); my $line_of_unicode = <$fh>; open(my $fh,'<:encoding(Big5)', 'anything'); my $line_of_unicode = <$fh>;
I got that code samples from perluniintro.pod, which is beautiful reading to start.

And yes, if you're not ready to move to perl-5.8.0 yet, then use Unicode::Map module to solve your task.

Courage, the Cowardly Dog.

Replies are listed 'Best First'.
Re: Re: files saved in unicode are not being read correctly
by Anonymous Monk on Jun 30, 2002 at 14:12 UTC

    I am using perl 5.6 release 631 from active state perl. where can I get active state perl 5.8? I searched google but 5.8 rc2 is available only on does that one have the Win32::Ole modules as well?

      In this case you better wait for a moment when 5.8.0 will be available, and ActiveState will prepare an "official" build for Win32 platform. Currently just use "Map::Unicode"!

      Courage, the Cowardly Dog.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2023-01-30 05:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found