Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^8: how to output file in Unicode

by anakin30 (Acolyte)
on Aug 27, 2012 at 13:26 UTC ( #989985=note: print w/replies, xml ) Need Help??


in reply to Re^7: how to output file in Unicode
in thread how to output file in Unicode

result is negative, i still see the givenname is not converted to Unicode UTF8, Example : Björn

i edit the script as below, but it doesn't help

open (OUTPUT, ">:encoding(UTF-8)",$outputfile) or die "Cannot open filename for input: $!";

how about using perl module (utf8::all) does it help?

yeah this is givenname :)

Replies are listed 'Best First'.
Re^9: how to output file in Unicode
by remiah (Hermit) on Aug 27, 2012 at 20:44 UTC

    One question. What do you use when you said "Björn"? I mean Browser? or Editor?

    Back to previous.

    open (OUTPUT, ">",$outputfile) or die "Cannot open filename for input: + $!";
    And Open your output file with Browser.What do you see when you change "Character Encoding" of Browser? Can you change it to UTF-8?

      this "Björn" appear only if i open the csv output file using microsoft excel

      using notepad or Editplus (editor) it looks good.

        What encoding does the "microsoft excel" program think the file is in?

        i changed it once, but it doesn't work out, i still seeing the character as "Björn".

        i don't know why? but how to ensure the output was delivered in UTF-8 encoded? is there any way i can prove?

        why the string still displayed as "Björn" even though i set the output to encoding(UTF-8), as below line

        open (OUTPUT, ">:encoding(UTF-8)",$outputfile) or die "Cannot open filename for input: $!";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989985]
help
Chatterbox?
[Tanktalus]: Wow, given the time separation of marioroy's oatmeal cookies and Disciplulus' response, I'm amazed that marioroy responded :)
[Discipulus]: no no seriously, redss posed a good question in the right moment, and you gave as always wonderful answers
[Discipulus]: Tanktalus my comment was about how to fork & join in tk?
[marioroy]: Oh, I've might of missed Discipulus's earlier response. I had gone to bed.
[Tanktalus]: ah, I don't even have the perlmonks site open in my browser :)
Tanktalus is chatting through his cbstats application :)
[marioroy]: Perl is so much fun.
[Discipulus]: Tanktalus i recently started a Meditation about marioroy's MCE suit of modules, but is even better to see a practical question answered than responses to my meditation
[Discipulus]: good night mario!

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-04-23 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.