File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ else if(c == '\r')
3737 a .append ("\\ r" );
3838 else if (c == '\t' )
3939 a .append ("\\ t" );
40+ else if (c == '\b' )
41+ a .append ("\\ b" );
4042 else if ( c < 32 )
4143 continue ;
4244 else
@@ -376,6 +378,7 @@ else if(check('\"'))
376378 continue ;
377379 }
378380 case 'n' : special = '\n' ; break ;
381+ case 'r' : special = '\r' ; break ;
379382 case 't' : special = '\t' ; break ;
380383 case 'b' : special = '\b' ; break ;
381384 }
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ public void testEscape1(){
200200 assertEquals ( x , JSON .parse ( x .toString () ) );
201201 assertEquals ( raw , ((DBObject )JSON .parse ( x .toString () ) ).get ( "x" ) );
202202
203- x = new BasicDBObject ( "x" , "a\n b\b c\t d" );
203+ x = new BasicDBObject ( "x" , "a\n b\b c\t d\r e " );
204204 assertEquals ( x , JSON .parse ( x .toString () ) );
205205 }
206206
You can’t perform that action at this time.
0 commit comments