Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Ignore - Failure to correctly interpret utf-8 characters

by atcroft (Abbot)
on Apr 25, 2021 at 17:13 UTC ( [id://11131706]=note: print w/replies, xml ) Need Help??


in reply to Ignore - Failure to correctly interpret utf-8 characters

Try changing line 2 from:
if ( open my $fh, '<', "321t.txt" ) {
to:
if ( open my $fh, '<:encoding(UTF-8)', "321t.txt" ) {

According to the documentation for open(), this will open a UTF-8-encoded file containing UTF-8 characters properly. (See also perluniintro.)

Hope that helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found