diff options
Diffstat (limited to 'src/unstable/json.cpp')
-rw-r--r-- | src/unstable/json.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp index adc2706..06df9b1 100644 --- a/src/unstable/json.cpp +++ b/src/unstable/json.cpp | |||
@@ -747,7 +747,16 @@ void Bu::Json::writeStr( const Bu::String &sStr, Bu::Stream &sOutput ) const | |||
747 | break; | 747 | break; |
748 | 748 | ||
749 | default: | 749 | default: |
750 | sOutput.write( &(*i), 1 ); | 750 | if( *i < 32 ) |
751 | sOutput.write( | ||
752 | Bu::String("\\u%1"). | ||
753 | arg( (int32_t)*i, Bu::Fmt::hex(4).fill('0') ). | ||
754 | end().getStr(), | ||
755 | 6 | ||
756 | ); | ||
757 | else | ||
758 | sOutput.write( &(*i), 1 ); | ||
759 | break; | ||
751 | } | 760 | } |
752 | } | 761 | } |
753 | sOutput.write("\"", 1 ); | 762 | sOutput.write("\"", 1 ); |