Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: "Wide character in print"

by ikegami (Patriarch)
on Sep 14, 2009 at 16:38 UTC ( [id://795179]=note: print w/replies, xml ) Need Help??


in reply to "Wide character in print"

The error has gone away but there are weird characters that are still showing up like this when I print it out:

There are many different ways of representing characters using bytes. These are called "character encodings", or just "encodings" for short.

By using :utf8, you told Perl to encode the characters using UTF-8. (Actually, using a superset of UTF-8 specific to Perl, but that's ok.) However, your viewer appears to be assuming the content of the file is encoded using iso-latin-1 (or something).

Tell your viewer the file is UTF-8, or use the encoding your viewer expects instead of UTF-8. The latter is done using:

binmode OUT, ':encoding(name_of_encoding_here)';

For files encoded using UTF-8, some viewers will react positively to having chr(0xFEFF) as the first character.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-19 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found