Re: Filename Encoding Help
- From: Adhal <fake@xxxxxxxxxxxxx>
- Date: Wed, 11 Jun 2008 12:22:28 +0100
Well, happens.
Idea: if acceptable for the user, write at the top of the file some
info on the code page used for the file.
(the way xml (optionally) does, with <?xml version="1.0" encoding="blah"?>)
You can even add something user friendly, but also easy to parse
(For instance:
Required code page: 932
If this file is opened on a Windows with a mismatching system code page,
it's content might look corrupted, and is most likely inintelligible
)
This way, if you can parse the first line and get the code page.
You can then use that (and Encoding.GetEncoding) to conver to Unicode.
So you will be able to use a Japanese-encoded file even on a Korean
(Russian, Greek, English, etc.) system, even if it looks bad in Notepad.
Would have never crossed my mind. Simple solution.
Thanks for that. :)
.
- References:
- Re: Filename Encoding Help
- From: Mihai N.
- Re: Filename Encoding Help
- From: Adhal
- Re: Filename Encoding Help
- From: Mihai N.
- Re: Filename Encoding Help
- From: Adhal
- Re: Filename Encoding Help
- From: Mihai N.
- Re: Filename Encoding Help
- Prev by Date: Re: Annoying Web Service Compilation Issue
- Next by Date: Re: Annoying Web Service Compilation Issue
- Previous by thread: Re: Filename Encoding Help
- Next by thread: Re: Filename Encoding Help
- Index(es):
Relevant Pages
|