[jira] [Commented] (TEXT-118) JSON escaping incorrect for the delete control character

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TEXT-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16632106#comment-16632106
 ] 

ASF GitHub Bot commented on TEXT-118:
-

Github user asfgit closed the pull request at:

https://github.com/apache/commons-text/pull/89


> JSON escaping incorrect for the delete control character
> 
>
> Key: TEXT-118
> URL: https://issues.apache.org/jira/browse/TEXT-118
> Project: Commons Text
>  Issue Type: Bug
>Affects Versions: 1.2
> Environment: JDK8u162, Mac OS X 13.something.
>Reporter: Dan Wallach
>Assignee: Rob Tompkins
>Priority: Minor
>
> Here's a simple unit test. The assertion about backspace succeeds. The 
> assertion about the delete character fails. Instead, the delete character 
> shows up in the escaped text. This violates the JSON spec, which forbids 
> "control characters" in strings.
> {code:java}
> @Test
> public void testDeleteCharacter() {
>   String backspaceString = "Backspace: \b";
>   String deleteString = "Delete: \u007F";
>   assertEquals("Backspace: \\b", 
> StringEscapeUtils.escapeJson(backspaceString));
>   assertEquals("Delete: \\u007F", StringEscapeUtils.escapeJson(deleteString));
> }
> {code}
>  
> The JSON spec doesn't have a specific escape for a delete character, but it 
> does explicitly exclude control characters from passing through. I'd 
> recommend behavior as in the above unit test.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TEXT-118) JSON escaping incorrect for the delete control character

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TEXT-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631844#comment-16631844
 ] 

ASF GitHub Bot commented on TEXT-118:
-

GitHub user nandorKollar opened a pull request:

https://github.com/apache/commons-text/pull/89

TEXT-118: JSON escaping incorrect for the delete control character



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/nandorKollar/commons-text TEXT-118

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-text/pull/89.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #89


commit 47aefa392ebe7e2ea777318b9c5d7f8b9d201b85
Author: Nandor Kollar 
Date:   2018-09-28T13:35:11Z

TEXT-118: JSON escaping incorrect for the delete control character




> JSON escaping incorrect for the delete control character
> 
>
> Key: TEXT-118
> URL: https://issues.apache.org/jira/browse/TEXT-118
> Project: Commons Text
>  Issue Type: Bug
>Affects Versions: 1.2
> Environment: JDK8u162, Mac OS X 13.something.
>Reporter: Dan Wallach
>Priority: Minor
>
> Here's a simple unit test. The assertion about backspace succeeds. The 
> assertion about the delete character fails. Instead, the delete character 
> shows up in the escaped text. This violates the JSON spec, which forbids 
> "control characters" in strings.
> {code:java}
> @Test
> public void testDeleteCharacter() {
>   String backspaceString = "Backspace: \b";
>   String deleteString = "Delete: \u007F";
>   assertEquals("Backspace: \\b", 
> StringEscapeUtils.escapeJson(backspaceString));
>   assertEquals("Delete: \\u007F", StringEscapeUtils.escapeJson(deleteString));
> }
> {code}
>  
> The JSON spec doesn't have a specific escape for a delete character, but it 
> does explicitly exclude control characters from passing through. I'd 
> recommend behavior as in the above unit test.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TEXT-118) JSON escaping incorrect for the delete control character

2018-05-17 Thread Pascal Schumacher (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16479579#comment-16479579
 ] 

Pascal Schumacher commented on TEXT-118:


Pull request welcome! :-)

> JSON escaping incorrect for the delete control character
> 
>
> Key: TEXT-118
> URL: https://issues.apache.org/jira/browse/TEXT-118
> Project: Commons Text
>  Issue Type: Bug
>Affects Versions: 1.2
> Environment: JDK8u162, Mac OS X 13.something.
>Reporter: Dan Wallach
>Priority: Minor
>
> Here's a simple unit test. The assertion about backspace succeeds. The 
> assertion about the delete character fails. Instead, the delete character 
> shows up in the escaped text. This violates the JSON spec, which forbids 
> "control characters" in strings.
> {code:java}
> @Test
> public void testDeleteCharacter() {
>   String backspaceString = "Backspace: \b";
>   String deleteString = "Delete: \u007F";
>   assertEquals("Backspace: \\b", 
> StringEscapeUtils.escapeJson(backspaceString));
>   assertEquals("Delete: \\u007F", StringEscapeUtils.escapeJson(deleteString));
> }
> {code}
>  
> The JSON spec doesn't have a specific escape for a delete character, but it 
> does explicitly exclude control characters from passing through. I'd 
> recommend behavior as in the above unit test.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)