Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: PERL UNIX and strangeness and char conversion

by ikegami (Patriarch)
on Jan 19, 2021 at 12:18 UTC ( [id://11127098]=note: print w/replies, xml ) Need Help??


in reply to PERL UNIX and strangeness and char conversion

The file doesn't contain <93> or \x{93}; it contains a byte with a value of 0x93. This is garbage (where found) when UTF-8 is expected. The two programs simply handle this garbage differently.


What you have is probably a file encoded using cp1252 rather than UTF-8. «“» and «”» are encoded as 93 and 94 respectively when using cp1252.

Convert the file's encoding from cp1252 to UTF-8 before using it with tools expecting UTF-8.

iconv -f cp1252 -t UTF-8 file.cp1252 >file.utf8

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-28 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found