Subject Re: Treat a VARCHAR OCTETS column as binary in Delphi
Author fxam
> Try using QuotedStr()
>
> ...field.AsString := QuotedStr('12 3B 00 AA');
>
Thanks Helen, but I need to store them in binary format to save space,
those are actually UTF-16 encoding, which may contain null characters. I
can store the null characters into the database, but I can't get the full
data back, as they are treated as null-terminated string when I call
AsString or GetData.

Why do I store UTF-16 in VARCHAR OCTETS but not UNICODE_FSS? Coz I can't
beat UNICODE_FSS, same issue with previous post titled "Firebird and
Unicode queries". I can choose to store UTF-8 in OCTETS which do not
contain null characters, but my data are mainly Asian characters, which
take less space in UTF-16.

By the way, I doubt that UNICODE_FSS is actually UTF-8, which store a-z as
1 byte, and more bytes for others. Because I see only one byte for 'a' and
two byte for 'ab' in Database Workbench's Blob Editor.