469,085 Members | 1,039 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,085 developers. It's quick & easy.

StreamWriter's problem

I try to use the StreamWriter to write from file reader
(my file reader is not a text file) and I got this error
message

streamWriter.Write(fileReader.ReadToEnd)

"Found a high surrogate char without a following low
surrogate at index: 325. The input may not be in this
encoding, or may not contain valid Unicode (UTF-16)
characters."
I don't know what does it mean. Can anybody help?
Nov 20 '05 #1
1 1730
Hi,

Ensure the reader has been created with the character encoding corresponding
to that of the actual source file content. If, say, your file is in ASCII or
in Windows-1252, reading it as a Unicode file will obviously fail.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"MrKrich" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
I try to use the StreamWriter to write from file reader
(my file reader is not a text file) and I got this error
message

streamWriter.Write(fileReader.ReadToEnd)

"Found a high surrogate char without a following low
surrogate at index: 325. The input may not be in this
encoding, or may not contain valid Unicode (UTF-16)
characters."
I don't know what does it mean. Can anybody help?


Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bob Hansen | last post: by
1 post views Thread by Lars Hansen | last post: by
13 posts views Thread by Rob Corwin | last post: by
5 posts views Thread by Rob Corwin | last post: by
5 posts views Thread by Brendan Miller | last post: by
9 posts views Thread by ShadowOfTheBeast | last post: by
5 posts views Thread by ramendra | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.