Re: need help withXMLHTTPreq and parsing response

"jason pollard" <jasonpollard@[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
"Christian Biesinger" <[email protected]> wrote in message
news:[email protected]...
> jason pollard wrote:
> > I just was looking for some rhyme or reason how
> > it's being converted, or why some bytes are converted to unicode, so
that I
> > can convert back to bytes (acutally ints < 255).
>
> Ah. Well, I mentioned that the data is apparently interpreted as
> windows-1252, did I not? Just translate it back.
>
> See, for example, the table at
> http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx
>
Oooooh (smacks forehead)......I was taking another look at this table.  I
thought it'd be useless because it doesn't even go above 255, but upon
looking at the x80 and x90 rows for one of my values, I noticed the win-1252
code to be in the x2000's, and indeed these values map to the correct int
values I get using java's InputStream.read().  So all I have to do is build
a table to translate the characters in question, and I'm good to go.  A
little more work than I wanted, but isn't it always?  So my problem is
solved, I believe.  Thanks for the help everybody.

BTW, the overrideMimeType function is clearly ignored in this case, as we've
determined that the chars coming in are windows-1252.  Why that is, I'm not
sure, but one thing I noticed, is that the other Western (ISO-8859-1 & 15 at
least) codepages don't have any characters defined for the x80s and 90s.
Why it doesn't just use UTF-8 I have no idea.

--Jason
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.