Re: XmlReader and first char



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
.



Relevant Pages

  • Re: XmlReader and first char
    ... A null char is a definite signal that the ... I am not sure why the white space in the ... My guess is that the stream has been created using a UTF-16 (or ... It wouldn't be valid XML, ...
    (microsoft.public.dotnet.framework)
  • Re: "Read stuff from a file and chop it up to do stuff" code advice wanted.
    ... ;; This function returns TRUE if any character ... (if (char< char #\!) ... a stream and an array to hold characters in temp memory. ... ;; resulting string. ...
    (comp.lang.lisp)
  • Re: Pointers
    ... it doesn't matter if you have white space before or after the '*'. ... char* a, b; ... 'b' isn't a pointer but a simple char variable despite the '*' after ...
    (comp.lang.c)
  • Re: Sending Chr(255) to Serial Port
    ... The fact IS, that SerialPort IS A STREAM, it has a property called ... list that appears after you press the dot. ... Why didn't they keep char, ... Write does not accept a Stream, ...
    (microsoft.public.dotnet.general)
  • Re: wofstream
    ... >I found that wide char file stream doesn't write national symbols. ... How can I switch text encoding? ... that includes a codecvt facet for the conversion. ...
    (microsoft.public.vc.stl)