Re: Problem writing non-englisg characters (re-post)
- From: "barry" <someone@xxxxxxxxxxxxx>
- Date: Mon, 11 Feb 2008 19:07:58 +0530
Sorry, i have not delebrately posted another thread, its cause i was
selecting "Reply" instead of "Reply Group" and did not have a proper e-mail
address setup and hence my message was not going through.
Now regarding the issue
How do i read from a website which has those odd characters like
"élémentaire" and then write them to a file.
do i use UTF8Encoding (default) or someother encoding for both reading and
writing these type of characters. Could you point me to some code or give
some idea.
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:60d8701f-1670-481c-986f-73939e4a2f48@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Feb 11, 11:37 am, "barry" <some...@xxxxxxxxxxxxx> wrote:
Thanks for your reply.
It's generally a good idea to keep all posts within the same thread
rather than starting a new thread each time.
I am parsing a French website, i found that it reads the characters
correctly when i open the .html file using
TextReader tr = new StreamReader("XYZ.htm", new UTF7Encoding(true)) ;
That sounds unlikely. UTF-7 is used in very specific circumstances
(mail, IIRC).
How are you validating that it's reading the characters correctly?
if am able to parse the data correctly, i have checked this using the
Visual
Studio 2003 Debugger, problem arises after writing the data to file which
i
open using
TextWriter tw = new StreamWriter("zxy.txt", false, new
UTF7Encoding(true));
tw.WriteLine("", new UTF7Encoding(true));
tw.close();
You really don't want to be using UTF7, either for reading or writing.
Jon
.
- Follow-Ups:
- Re: Problem writing non-englisg characters (re-post)
- From: Jon Skeet [C# MVP]
- Re: Problem writing non-englisg characters (re-post)
- References:
- Problem writing non-englisg characters (re-post)
- From: barry
- Re: Problem writing non-englisg characters (re-post)
- From: Jon Skeet [C# MVP]
- Problem writing non-englisg characters (re-post)
- Prev by Date: Re: DataTable.Select Not Working In DataGridView events
- Next by Date: Visual Studio Comment Hiding
- Previous by thread: Re: Problem writing non-englisg characters (re-post)
- Next by thread: Re: Problem writing non-englisg characters (re-post)
- Index(es):
Relevant Pages
|