Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 contemplating the Monastery: (3)
As of 2025-12-12 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (92 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.