[ 
https://issues.apache.org/jira/browse/PIVOT-967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roger Whitcomb resolved PIVOT-967.
----------------------------------
    Resolution: Fixed

I have updated the "map.json" file and JSONSerializerTest to test all these 
changes.

Once more thing:  JSONSerializer.writeObject couldn't correctly handle a 
java.util.Map passed in as the object, so I recognize this case now and put a 
MapAdapter around it.
This also is tested in JSONSerializerTest.

trunk:
Sending        core\src\org\apache\pivot\json\JSONSerializer.java
Sending        core\test\org\apache\pivot\json\test\JSONSerializerTest.java
Sending        core\test\org\apache\pivot\json\test\map.json
Transmitting file data ...
Committed revision 1675517.

branches/2.0.x (merged with some Java 1.7 -> 1.6 changes):
Sending        .
Sending        core\src\org\apache\pivot\json\JSONSerializer.java
Sending        core\test\org\apache\pivot\json\test\JSONSerializerTest.java
Sending        core\test\org\apache\pivot\json\test\map.json
Transmitting file data ...
Committed revision 1675522.

> JSONSerializer doesn't correctly handle CR characters
> -----------------------------------------------------
>
>                 Key: PIVOT-967
>                 URL: https://issues.apache.org/jira/browse/PIVOT-967
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-serialization
>    Affects Versions: 2.0.4, 2.1, 2.0.5
>         Environment: All, but particularly Windows
>            Reporter: Roger Whitcomb
>            Assignee: Roger Whitcomb
>            Priority: Minor
>             Fix For: 2.1, 2.0.5
>
>         Attachments: 967.patch
>
>
> The JSON standard (see JSON.org) defines specific escape sequences for the 
> following characters:  \b, \f, \n, \r, \t and \uxxxx for other control 
> characters.  But the encoding logic in JSONSerializer doesn't match this list 
> (particularly missing \r and not encoding other control characters using 
> \uxxxx).  The "writeObject" method only recognizes \t and \n and does not 
> encode any control character less than 0xFF.  The "readString" method seems a 
> bit weird also in its handling of control characters in the input.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to