Hey all,

I have hit the unicode roadblock with SOCI again. I absolutely must
store internationalized strings in my databases and SOCI won't allow me
to do that. When asking the same question on this list before I only
got: "use UTF-8, std::string is good enough for that". However, that is
not an option for me, since MS SQL Server does not support UTF-8 but
only UCS-2
(http://support.microsoft.com/?scid=kb%3Ben-us%3B232580&x=12&y=2).

1) SQLServer via SOCI ODBC:
I have tried manually creating a multi byte UTF-16 std::string and
passing that to a soci::use statement. I have verified the correct
string length (i.e. no truncation when creating the std::string). When
inserting this string with soci the string is truncated after the first
character (when SOCI encounters the first 0 byte).

2) SQLServer via SOCI ODBC:
I have unicode data stored in nvarchar fields in the database. If I use
soci::into( std::string ) to retrieve it the string will have the
correct length in characters but _not_ in bytes. I.e. I get one char per
unicode symbol. This is completely unusable as half the information
contained in the original string was just silently dropped by SOCI.

3) SQLite3 via SOCI native backend:
soci::session takes a std::string as it's connection string argument.
This is bad. Take the SQLite database backend as an example: The
connection string is a filename. All newer systems are on unicode
filesystems... There is no way to open a database on a unicode path
(like say, the home directory containing the user's name).

Any workarounds? Is anyone working on a fix?

regards,

    Sören

BTW: what's the status on SOCI in general? Is the project still alive?
Anyone writing code for it? Seems awfully quiet around here.

-- 
Sören Meyer-Eppler
software developer
[email protected]
http://www.BuschnicK.net

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to