Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^7: how to output file in Unicode

by remiah (Hermit)
on Aug 27, 2012 at 12:07 UTC ( #989973=note: print w/replies, xml ) Need Help??

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

So, what's going on if first open, let it open with utf-8 io layer?
open (FH, ">$outputfile") or die "$!";
revise to
open (OUTPUT, ">:encoding(UTF-8)",$outputfile or die "$!";
What is the result?

Second question: Is that $givenname?

Replies are listed 'Best First'.
Re^8: how to output file in Unicode
by anakin30 (Acolyte) on Aug 27, 2012 at 13:26 UTC

    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 :)

      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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989973]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-06-21 23:52 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (120 votes). Check out past polls.