Dominique Devienne wrote: > On Fri, Nov 27, 2015 at 2:16 PM, Dan Kennedy <danielk1977 at gmail.com> wrote: > >> On 11/27/2015 12:13 PM, Igor Korot wrote: >> >>> Hi, >>> Is there any way to have "sqlite3_errmsg" function return a wide char >>> string? >>> Or do a conversion in a portable way? >>> >> Will sqlite3_errmsg16() work for you? >> >> https://www.sqlite.org/c3ref/errcode.html > > That's UTF-16, while a wstring is expected to be in the current locale > (which won't be UTF-16 on Windows). Excuse me, but the std::wstring type is based on wchar and has no codepage assigned to it. And under windows, that's the standard type to use to talk to the W suffix APIs, thus giving them the UTF-16 that they are expecting.
I'm using the sqlite3_errmsg16 function here under windows, and gives me exactly what I need to be sent to, say, the MessageBoxW Win32 API.