Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

XMLHttpRequest stripping unprintable characters?

Author Message
fletch



Joined: 08 May 2005
Posts: 13

Posted: Sun May 08, 2005 - 1:16 am    Post subject: XMLHttpRequest stripping unprintable characters? Reply with quote

I'm using XMLHttpRequest to connect to a data provider who uses the NULL character (\x00) as a delimiter. This is unfortunately of my control. I was testing some of my stuff in firefox and all was working great. I could just call responseText.split(/\x00/) and have I'd have an array of fields.

I've moved my testing to safari and split()'ing on \x00 doesn't work. At first I thought it was just a problem with safari's ability to split on the NULL character, but this code works fine:
Code:
var test = "field1\x00field2";
var fields = test.split(/\x00/);
// fields.length is now 2, as expected

It looks like the NULLs are being completely stripped by Safari before I get to read the data in responseText.

I've tried a few things but I'm running out of ideas. Can anyone think of a possible way around this problem? Is there some safari-specific XMLHttpRequest property (other than resposeText) where the NULLs might have been preserved?

FYI, I'm reading the data as it comes in (readyState 3), not waiting until the connection is closed.

Thanks.
View user's profile Send private message Send e-mail Visit poster's website Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group