Re: XmlReader and first char
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Wed, 13 Sep 2006 20:19:32 +0100
Cowboy (Gregory A. Beamer) <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx> wrote:
When you stream, the streamreader will attempt to determine if the entire
transmission is bogus or not. A null char is a definite signal that the
stream is bad or non-existent. I am not sure why the white space in the
first position would be seen as a null char, but I am not overly surprised
either.
My guess is that the stream has been created using a UTF-16 (or
similar) encoding, giving 0 as the first byte.
Remember that files, with the exception of ascii files, begin with real
characters, not white space.
On what grounds? There's not reason why a text file stored in UTF-16 shouldn't
start with spaces, for instance. It wouldn't be valid XML, but it's a
perfectly reaosnable text file.
--
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
.
- Follow-Ups:
- Re: XmlReader and first char
- From: Cowboy \(Gregory A. Beamer\)
- Re: XmlReader and first char
- Prev by Date: Re: XmlReader and first char
- Next by Date: Re: Possible bug in UnicodeEncoding
- Previous by thread: Re: XmlReader and first char
- Next by thread: Re: XmlReader and first char
- Index(es):
Relevant Pages
|