Subject | Writing UTF16 to the database |
---|---|
Author | Dave Smith |
Post date | 2005-02-15T18:45:38Z |
Hello,
I've been working with firebird for a little while now, and find that
it's a great alternative to some of the larger databases, but I'm having
a problem now that I've started to work with unicode.
I'm writing in C and have started using wchar_t strings internally, and
wish to write the contents of these to a firebird db. However, having
set the character set for the VARCHAR field to Unicode_fss, only the
first character of the field is written to the field (as I guess it
finds that the second byte in the string is zero). Is there a function I
can use to write a wchar_t string (UTF-16) to this field?
Alternatively, is there a way of encoding a wchar_t to a single byte
encoding (must be able to store international data - maybe utf-8?) so
that IT could go into firebird instead?
What would be the best solution?
Thanks,
Dave Smith
I've been working with firebird for a little while now, and find that
it's a great alternative to some of the larger databases, but I'm having
a problem now that I've started to work with unicode.
I'm writing in C and have started using wchar_t strings internally, and
wish to write the contents of these to a firebird db. However, having
set the character set for the VARCHAR field to Unicode_fss, only the
first character of the field is written to the field (as I guess it
finds that the second byte in the string is zero). Is there a function I
can use to write a wchar_t string (UTF-16) to this field?
Alternatively, is there a way of encoding a wchar_t to a single byte
encoding (must be able to store international data - maybe utf-8?) so
that IT could go into firebird instead?
What would be the best solution?
Thanks,
Dave Smith