comparison src/c/urweb.c @ 1689:ae22d1fd9b80

Pass non-printing characters through unchanged in sqlifyString, to support UTF-8
author Adam Chlipala <adam@chlipala.net>
date Sat, 03 Mar 2012 15:47:52 -0500
parents 225b87d4a7df
children 6f2f74cc4ead
comparison
equal deleted inserted replaced
1688:8c2e8d41a8f2 1689:ae22d1fd9b80
2427 else if (uw_Estrings) { 2427 else if (uw_Estrings) {
2428 sprintf(s2, "\\%03o", c); 2428 sprintf(s2, "\\%03o", c);
2429 s2 += 4; 2429 s2 += 4;
2430 } 2430 }
2431 else 2431 else
2432 uw_error(ctx, FATAL, "Non-printable character %u in string to SQLify", c); 2432 *s2++ = c; // I hope this is safe to do... don't know how to support UTF-8 outside Postgres otherwise!
2433 } 2433 }
2434 } 2434 }
2435 2435
2436 *s2++ = '\''; 2436 *s2++ = '\'';
2437 strcpy(s2, uw_sqlsuffixString); 2437 strcpy(s2, uw_sqlsuffixString);