472,145 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

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 1778
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
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.