List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:September 10 2003 3:01am
Subject:Re: Storing Unprintable Characters
View as plain text  
In the last episode (Sep 09), Andrew Kuebler said:
> I need to store strings encrypted with TripleDES that sometimes
> contain unprintable characters (Hexidecimal values under 20). The
> values do not seem to properly store in CHAR columns and I don't see
> any other column types that might work.

CHAR fields are allowed to strip trailing blanks.  Try a BLOB field. 
Also make sure you escape your strings with whatever feature your
language makes available.  In C, for example, you would use
mysql_real_escape_string().  If your interface supports bind variables,
use them instead.

http://www.mysql.com/doc/en/mysql_real_escape_string.html

-- 
	Dan Nelson
	dnelson@stripped
Thread
Storing Unprintable CharactersAndrew Kuebler10 Sep
  • Re: Storing Unprintable CharactersDan Nelson10 Sep