Hi,
I am trying to find out why the following code fails to do proper conversion.
It works if the tableName have "abcd", but fails if it has "abcß" (the
German letter for the "ss" (looks like Greek letter beta)).

struct Table
{
    std::wstring name;
    std::vector<Fields> fields;
    std::vector<FKeys> foreign_keys;
};

std::wstring_convert<std::codecvt_utf8<wchar_t> > myconv;
const unsigned char *tableName = sqlite3_column_text( stmt, 0 );
pimpl->m_tables[m_catalog].push_back( Table( myconv.from_bytes( (const
char *) tableName ), fields, foreign_keys ) );

The myconv.from_bytes() call fails in the latter case.
According to the SQLite documentation everything is stored as UTF-8,
so I am converting
from UTF-8 to std::wstring.

I'm currently on Windows (8.1) with MSVC 2010 Pro, but the code is
also crashes on OSX
with clang and *nix with gcc 5.2.

The letter "ß" is the proper Unicode symbol, so this conversion should work.

Thank you.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to