Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: how to output file in Unicode

by moritz (Cardinal)
on Aug 23, 2012 at 20:51 UTC ( #989379=note: print w/ replies, xml ) Need Help??


in reply to how to output file in Unicode

Unicode is not a file format.

Unicode is rather abstract concept: a collection of characters, and a mapping from the characters to numbers.

But to write a file, there is one step missing: a character encoding, that transforms those numbers into bytes. Popular ones are UTF-8, and UTF-16LE, UTF-16BE and UTF-32.

Some programs on windows write "Unicode" when they mean one of the UTF-16 encodings, but it's still wrong.

So, what encoding do you want?

Also please read Encodings and Unicode.


Comment on Re: how to output file in Unicode
Re^2: how to output file in Unicode
by anakin30 (Acolyte) on Aug 23, 2012 at 20:58 UTC

    My apology,i've missed out a step over here. I want to output file into Unicode (UTF-8). thanks for your reply

      hello anakin30

      How do you get the string you are going to print ?
      From file? from database? or it is the result of some module?

      And do you know the encoding of the string?

        Hi remiah

        I run a Perl script to extract user attribute values from LDAP.

        Extracted output file contains First Name and Last Name of German users.

        Supposed Last Name should be displayed as "Björn", but it is displayed as "Björn", which seems to be unrecognizable.

        I learned that the output file was created in ASCII format should be created in Unicode UTF-8 format in order the German character to be visible.

        thanks

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (15)
As of 2014-10-24 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (132 votes), past polls