File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,11 +249,11 @@ void encodeBasicSWAR(ByteList src) throws IOException {
249249
250250 if (pos + 4 <= len ) {
251251 int x = bb .getInt (ptr + pos );
252- int is_ascii = 0x808080 & ~x ;
253- int xor2 = x ^ 0x020202 ;
254- int lt32_or_eq34 = xor2 - 0x212121 ;
255- int sub92 = x ^ 0x5C5C5C ;
256- int eq92 = (sub92 - 0x010101 );
252+ int is_ascii = 0x80808080 & ~x ;
253+ int xor2 = x ^ 0x02020202 ;
254+ int lt32_or_eq34 = xor2 - 0x21212121 ;
255+ int sub92 = x ^ 0x5C5C5C5C ;
256+ int eq92 = (sub92 - 0x01010101 );
257257 boolean skip_chunk = ((lt32_or_eq34 | eq92 ) & is_ascii ) == 0 ;
258258 if (skip_chunk ) {
259259 pos += 4 ;
Original file line number Diff line number Diff line change @@ -474,6 +474,18 @@ def test_backslash
474474 json = '["\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\""]'
475475 assert_equal json , generate ( data )
476476 #
477+ data = '"""""'
478+ json = '"\"\"\"\"\""'
479+ assert_equal json , generate ( data )
480+ #
481+ data = "abc\n "
482+ json = '"abc\\n"'
483+ assert_equal json , generate ( data )
484+ #
485+ data = "\n abc"
486+ json = '"\\nabc"'
487+ assert_equal json , generate ( data )
488+ #
477489 data = [ "'" ]
478490 json = '["\\\'"]'
479491 assert_equal '["\'"]' , generate ( data )
You can’t perform that action at this time.
0 commit comments