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]> |
Hi, Thanks for the response. I think you are correct that the unicode value there is \u201c, I've just been outputting the charCodeAt() to screen which gives the decimal value. At any rate, the value is above 255, which is screwing things up. I read that unicode strings (except for utf-8) signal their arrival by a xFFFE or xFEFF, so I was thinking that whatever is parsing the incoming stream is putting that there and I was trying to figure out a way to extract that from the string byte, but no go. You can access the actual stream here: http://bvserver.inetats.com/SERVICE/SQUOTE?STOCK=DELL The offending character in question is the "oe" one (/u339, decimal, should be \x96 or 156 decimal), if you can see that in your browser (I'm using Western-1252 encoding). I understand that the stream is being converted automatically to Unicode, 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). Could someone post a link to the relevant source code? I took a look at the Mozilla repository, but I'm not fluent in C so it didn't help at all. Thanks, --Jason "Christian Biesinger" <[email protected]> wrote in message news:[email protected]... > jason pollard wrote: > > All the characters are recognized normally, but the Unicode one. In this > > case the \u8220 should be (int)147. > > Hm, that \u8220 should be \u201c I'd think... U+201C is "left double > quotation mark"; In windows-1252 that's the character at position 147 > (0x93). The data you get is not bytes, but a text stream; the incoming > data was converted to unicode.