Opera doesn't understand the NULL byte :-\

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Opera doesn't understand the NULL byte :-\

Post by Chris Corbyn »

I'm using AJAX and sending a result from the server as a delimited string. The delimiter I'm using is "\0" the NULL byte. The works fine in IE and FF which can split the string at '\0' but Opera just refuses to recognize it as a null byte :(

In PHP I'm sending it like this:

Code: Select all

exit($item1."\0".$items2."\0".$item3); //etc etc
And in the JS I'm doing:

Code: Select all

var parts = httpReq.responseText.split('\0');
I've switched to using the DELETE code \x7f instead which seems to work but I still don't get why it doesn't like the null byte :? Bug?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

in Opera 9b1 this does work as expected (when entered in address bar):
javascript:alert('asd\0sdf'.split('\0'))
Post Reply