Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: How do I convert a sequence of hexes (D0 D6) to Chinese characters (中)?

by grantm (Parson)
on Jun 13, 2011 at 11:36 UTC ( [id://909368]=note: print w/replies, xml ) Need Help??


in reply to Re^4: How do I convert a sequence of hexes (D0 D6) to Chinese characters (中)?
in thread How do I convert a sequence of hexes (D0 D6) to Chinese characters (中)?

My example script simply printed out UTF-8 characters on STDOUT. In my case I ran the script in GNOME terminal under Linux and the correct character was displayed. Under Linux, your $LANG environment variable would typically need to be set to a UTF-8 locale for this to work (mine is set to "en_NZ.UTF-8"). If you were trying to run the script on Windows, it is very unlikely the command window will correctly display UTF-8.

But printing to STDOUT is only one option for output. You might chose to write to a file or a database or even a network socket. If you write to a file, you should be able to open and view the file in a web browser - all web browsers understand UTF-8.

  • Comment on Re^5: How do I convert a sequence of hexes (D0 D6) to Chinese characters (中)?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-20 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found