[
https://issues.apache.org/jira/browse/COUCHDB-1624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michiel Meeuwissen updated COUCHDB-1624:
----------------------------------------
Attachment: Test.java
The following java program demonstrates the problem.
git clone https://code.google.com/p/svenson/
cd svenson
ant
michiel@belono:/tmp/svenson$ javac -classpath ./bin/svenson-1.4.1.jar Test.java
michiel@belono:/tmp/svenson$ java -classpath
.:./bin/svenson-1.4.1.jar:./lib/compile/slf4j-api-1.6.1.jar Test
/tmp/10571721.json
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.
Exception in thread "main" org.svenson.JSONParseException: Illegal control
character 0x93
at
org.svenson.tokenize.JSONTokenizer.parseString(JSONTokenizer.java:405)
at org.svenson.tokenize.JSONTokenizer.next(JSONTokenizer.java:187)
at org.svenson.JSONParser.parseObjectInto(JSONParser.java:553)
at org.svenson.JSONParser.parseArrayInto(JSONParser.java:489)
at org.svenson.JSONParser.parseObjectInto(JSONParser.java:647)
at org.svenson.JSONParser.parse(JSONParser.java:391)
at org.svenson.JSONParser.parse(JSONParser.java:336)
at Test.main(Test.java:17)
:
> CouchDB shouldn't accept or serve JSON with control-characters
> --------------------------------------------------------------
>
> Key: COUCHDB-1624
> URL: https://issues.apache.org/jira/browse/COUCHDB-1624
> Project: CouchDB
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: Nils Breunese
> Attachments: 10571721.json, Test.java
>
>
> According to http://www.json.org/ control-characters are not valid characters
> in JSON. Due to a character encoding bug one of our applications was sending
> JSON with control-characters to CouchDB. CouchDB happily accepts this
> (invalid) JSON and also serves it, but then we started getting problems in a
> client that uses the Svenson JSON library which (correctly) complains about
> invalid characters in the JSON served by CouchDB.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira