Bug 26802 - JSON.parse fails to parse valid JSON with most Unicode characters
Summary: JSON.parse fails to parse valid JSON with most Unicode characters
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2009-06-29 10:03 PDT by Daniel Fazekas
Modified: 2009-06-29 15:34 PDT (History)
1 user (show)

See Also:


Attachments
Fixeration! (4.62 KB, patch)
2009-06-29 13:18 PDT, Oliver Hunt
barraclough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Fazekas 2009-06-29 10:03:48 PDT
The new native JSON support in the nightly builds breaks most non-Western Latin websites, as it fails to parse almost any character other than certain basic Latin 1 letters.

Example:
JSON.parse('"•"');
SyntaxError: Unable to parse JSON string

It even fails to round-trip between its own stringify and parse:
JSON.parse(JSON.stringify('•'));
SyntaxError: Unable to parse JSON string

These of course all work fine with Firefox 3.5, IE 8.0 or Douglas Crockford's JSON2.js.
Comment 1 Mark Rowe (bdash) 2009-06-29 11:02:08 PDT
<rdar://problem/7016214>
Comment 2 Oliver Hunt 2009-06-29 13:18:52 PDT
Created attachment 32018 [details]
Fixeration!
Comment 3 Gavin Barraclough 2009-06-29 15:28:10 PDT
Comment on attachment 32018 [details]
Fixeration!

In the ChangeLog, 'I' is spelled incorrectly. :-P
Comment 4 Oliver Hunt 2009-06-29 15:34:30 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/runtime/LiteralParser.cpp
	M	LayoutTests/ChangeLog
	M	LayoutTests/fast/js/JSON-parse-expected.txt
	M	LayoutTests/fast/js/resources/JSON-parse.js
Committed r45356