mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
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:
parent
f4fb332a58
commit
e44f96c88c
1 changed files with 1 additions and 7 deletions
|
@ -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, "\"" );
|
||||
|
|
Loading…
Reference in a new issue