On Aug 8, 3:34 pm, Maate <ma...@retkomma.dkwrote:
Quote:
I'm not sure I understand the phrase 'unicode data saved as ASCII' - I
guess either the text is ASCII-encoded, or else it is Unicode-encoded?
>
No matter what, you need to specify an encoding in your code, e.g.:
>
System.IO.StreamReader sr = new System.IO.StreamReader("test.txt",
System.Text.Encoding.ASCII)
>
or
>
System.IO.StreamReader sr = new System.IO.StreamReader("test.txt",
System.Text.Encoding.UTF8)
Well, if it *is* in UTF-8 then you don't need to specify the encoding
- UTF-8 is picked by default by pretty much all the .NET classes (in
this case the docs aren't terribly clear, unfortunately).
Quote:
You can also try out different encodings from the intellisense if you
don't know how your file is encoded. If your text still looks funny,
try posting a sample. Hope this is any help.
Note that if we do end up seeing a sample, it's probably best to post
the hex version of it - just posting the text will involve other
encoding conversions, which kinda defeats the point...
Jon