Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: utf file to ansi, but doesn't work?

by fullermd (Priest)
on Mar 01, 2011 at 08:53 UTC ( #890702=note: print w/replies, xml ) Need Help??


in reply to Re^2: utf file to ansi, but doesn't work?
in thread utf file to ansi, but doesn't work?

Is there a simple way I can check the header (i.e "type") of a file?

There isn't in general any such thing. All there is in a text file is what you see; that's what makes it text. UTF-x files can (and sometimes must) have a BOM, but ISO-8859's won't.

Your text editor either has to be told (by you, by default config, etc) what encoding to use, or it can try (and occasionally even succeed) to guess by the patterns of bytes in it. But it has no way to be know unless you tell it. That's why text encoding is such a mess...

  • Comment on Re^3: utf file to ansi, but doesn't work?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://890702]
help
Chatterbox?
[Discipulus]: eh, at the end i cannot compete with brother choroba, i just profited he is at lunch
[pra]: What is the best way to determine if a given string is a valid color?
[Discipulus]: context pra? tk html console naturla language?
[Corion]: Or HTML color like #c0ffee ?
[pra]: Perl/Tk. I want to input a file that will contain color names, but users might not know what names are valid

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-10-17 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (226 votes). Check out past polls.

    Notices?