kahntang / as3corelib

Automatically exported from code.google.com/p/as3corelib
0 stars 0 forks source link

isWhiteSpace() in JSONTokenizer.as is only checking for 3 of the 4 white space characters #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a JSON string with '\r' as white space.
2. Run JSON.decode on that string
3.

What is the expected output? What do you see instead?

Should ignore '\r' as white space per RFC.  Instead get parse error due to 
unexpected character.

What version of the product are you using? On what operating system?

0.9 dated March 19.  Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by alanhk...@gmail.com on 12 Jul 2007 at 11:23

GoogleCodeExporter commented 9 years ago
I second this one.  In a recent project we had a JSON file that we handed off 
to the
client for them to make small changes.  They made said changes on a Windows 
machine
which saved with DOS-style line endings (CRLF) which broke the  deserializer.  
I'm
currently getting around this by stripping out carriage returns manually (loop 
the
loaded file and do jsonString.replace("\r", "") where jsonString is the data of 
the
loaded file) before sending it to the deserializer.

Original comment by rick.ter...@gmail.com on 18 Dec 2007 at 9:02

GoogleCodeExporter commented 9 years ago
All in favor say aye ... 

Original comment by Griffin3...@gmail.com on 29 Mar 2008 at 2:47

GoogleCodeExporter commented 9 years ago
Aye. This also causes problems on Macs, since they (for some god awful reason) 
use a
single CR line delimiter (as opposed to windows CRLF and linux LF).

Original comment by evan.kaufman on 31 Mar 2008 at 7:15

GoogleCodeExporter commented 9 years ago
This is fixed in the source code. Just link the source until we build a new SWC.

Original comment by mikechambers on 2 Jul 2008 at 4:21