Send UTF-8 characters straight out in the JSON without encoding further

The code still handles escaping of control characters and double quotes.

Bugs #1089, #1169 and #1190 may be fixed by this commit.
This commit is contained in:
Mukund Sivaraman 2008-08-17 21:53:24 +00:00
parent f4fb332a58
commit e44f96c88c
1 changed files with 1 additions and 7 deletions

View File

@ -1165,13 +1165,7 @@ jsonStringFunc( const tr_benc * val, void * vdata )
case '\t': evbuffer_add_printf( data->out, "\\t" ); break;
case '"' : evbuffer_add_printf( data->out, "\\\"" ); break;
case '\\': evbuffer_add_printf( data->out, "\\\\" ); break;
default: {
if( isascii( *it ) )
evbuffer_add_printf( data->out, "%c", *it );
else
evbuffer_add_printf( data->out, "\\u%0x", (unsigned int)*it );
break;
}
default: evbuffer_add_printf( data->out, "%c", *it );
}
}
evbuffer_add_printf( data->out, "\"" );