From: erickson Date: Tue, 2 Jan 2007 21:33:59 +0000 (+0000) Subject: any unhandled char below ascii 32 will now be encoded as utf8 (\uXXXX) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c840a8fa42a3eedc38f2c3a38a3caa6f1d751560;p=opensrf%2Fbjwebb.git any unhandled char below ascii 32 will now be encoded as utf8 (\uXXXX) git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@808 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/utils/utils.c b/src/utils/utils.c index 3c7a2d6..56b8e4e 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -334,17 +334,9 @@ char* uescape( const char* string, int size, int full_escape ) { OSRF_BUFFER_ADD_CHAR(buf, '\\'); break; - case 30: /* record separator */ - OSRF_BUFFER_ADD(buf, "\\u001E"); - break; - - case 1: /* record separator */ - OSRF_BUFFER_ADD(buf, "\\u0001"); - break; - - default: - OSRF_BUFFER_ADD_CHAR(buf, c); + if( c < 32 ) buffer_fadd(buf, "\\u%0.4x", c); + else OSRF_BUFFER_ADD_CHAR(buf, c); } } else {