Re: Missing characters after file rewrite using File.OpenText
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Sat, 18 Feb 2006 07:13:14 -0000
Zark3 <Zark3net@xxxxxxxxx> wrote:
Unsure if this is the best group to place this, but here it is anyway
;).
I've got a large text file that needs rewriting into a different
format, and decided to try it using C#, which usually does my
programming tricks... However, this time I've got a difference of
opinion with the result :(
In words using accents and special chars (i.e. façade [c cedilla] or
één [e acute]) the result of my efforts just omits these characters.
Not the words entirely, just those letters. (i.e. façade turns into
faade). Pretty much, my question is why? I'm probably just forgetting
to set a text-encoding variable somewhere, but I can't seem to find out
where it should go.
If your input file isn't in UTF-8, you should specify the encoding when
you create your StreamReader.
If your output file isn't meant to be UTF-8, you should specify the
encoding when you create your StreamWriter.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Prev by Date: Re: garbled long value returned from the network
- Next by Date: Re: loading form from another thread
- Previous by thread: Missing characters after file rewrite using File.OpenText
- Next by thread: Array duplicates
- Index(es):
Relevant Pages
|