lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r950125 - in /lucene/dev/trunk/solr: CHANGES.txt src/java/org/apache/solr/response/JSONResponseWriter.java
Date Tue, 01 Jun 2010 15:47:03 GMT
Author: yonik
Date: Tue Jun  1 15:47:03 2010
New Revision: 950125

URL: http://svn.apache.org/viewvc?rev=950125&view=rev
Log:
escape U+2028 in JSON responses

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/src/java/org/apache/solr/response/JSONResponseWriter.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=950125&r1=950124&r2=950125&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Tue Jun  1 15:47:03 2010
@@ -318,6 +318,9 @@ Bug Fixes
 * SOLR-1928: TermsComponent didn't correctly break ties for non-text
   fields sorted by count. (yonik)
 
+* SOLR-1936: The JSON response format needed to escape unicode code point
+  U+2028 - 'LINE SEPARATOR' (Robert Hofstra, yonik)
+
 
 Other Changes
 ----------------------

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/response/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/response/JSONResponseWriter.java?rev=950125&r1=950124&r2=950125&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/response/JSONResponseWriter.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/response/JSONResponseWriter.java Tue Jun
 1 15:47:03 2010
@@ -613,7 +613,7 @@ class JSONWriter extends TextResponseWri
 
       for (int i=0; i<val.length(); i++) {
         char ch = val.charAt(i);
-        if ((ch > '#' && ch != '\\') || ch==' ') { // fast path
+        if ((ch > '#' && ch != '\\' && ch !=  '\u2028') || ch==' ') {
// fast path
           writer.write(ch);
           continue;
         }
@@ -628,6 +628,7 @@ class JSONWriter extends TextResponseWri
           case '\t': writer.write('\\'); writer.write('t'); break;
           case '\b': writer.write('\\'); writer.write('b'); break;
           case '\f': writer.write('\\'); writer.write('f'); break;
+          case '\u2028': unicodeEscape(writer,ch); break;
           // case '/':
           default: {
             if (ch <= 0x1F) {



Mime
View raw message