[sqlite] sqlite3_errmsg and wide char

2015-12-08 Thread Simon Slavin
On 8 Dec 2015, at 12:31am, Scott Robison wrote: > This may be true of OS X, but it not true of Mac all through history. They > might not have been called "code pages" but Mac most definitely had > different character sets to support different markets. Yep. OS 9 supported string processing and

[sqlite] sqlite3_errmsg and wide char

2015-12-07 Thread Scott Robison
On Fri, Nov 27, 2015 at 1:13 PM, Simon Slavin wrote: > > On 27 Nov 2015, at 7:03pm, Igor Korot wrote: > > > But what about Linux/Mac? > > Can I use that function there? > > Code pages are a Microsoft thing. Macs just have ASCII and Unicode, with > easy-to-use system functions to convert

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dan Kennedy
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 Dan.

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Simon Slavin
On 27 Nov 2015, at 7:03pm, Igor Korot wrote: > But what about Linux/Mac? > Can I use that function there? Code pages are a Microsoft thing. Macs just have ASCII and Unicode, with easy-to-use system functions to convert between them. There's no need to worry about locales and code pages and

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dominique Devienne
On Fri, Nov 27, 2015 at 2:45 PM, OBones wrote: > Dominique Devienne wrote: > >> 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

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread OBones
Dominique Devienne wrote: > On Fri, Nov 27, 2015 at 2:16 PM, Dan Kennedy 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()

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dominique Devienne
On Fri, Nov 27, 2015 at 2:16 PM, Dan Kennedy 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? > >

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Igor Korot
Hi, guys. But what about Linux/Mac? Can I use that function there? Thank you. On Nov 27, 2015 9:54 AM, "Dominique Devienne" wrote: > On Fri, Nov 27, 2015 at 2:45 PM, OBones wrote: > > > Dominique Devienne wrote: > > > >> That's UTF-16, while a wstring is expected to be in the current locale >

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Scott Robison
On Fri, Nov 27, 2015 at 12:03 PM, Igor Korot wrote: > Hi, guys. > But what about Linux/Mac? > Can I use that function there? > It will always give you a UTF-16 encoded string as a void*. To get it into a wstring would involve extracting the 16 bit code points and possibly converting them to 32

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dominique Devienne
On Fri, Nov 27, 2015 at 6:13 AM, Igor Korot wrote: > Is there any way to have "sqlite3_errmsg" function return a wide char > string? > Or do a conversion in a portable way? > Portably, not using standard C++ AFAIK. But there are several OSS frameworks that hide platform differences. Since

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Igor Korot
Hi, Scott, On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison wrote: > On Thu, Nov 26, 2015 at 10: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? >> >> Thank you. > > The portable way

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Scott Robison
On Fri, Nov 27, 2015 at 1:19 AM, J Decker wrote: > On Fri, Nov 27, 2015 at 12:17 AM, Scott Robison > wrote: > > On Thu, Nov 26, 2015 at 11:42 PM, Igor Korot wrote: > > > >> Hi, Scott, > >> > >> On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison > > >> wrote: > >> > On Thu, Nov 26, 2015 at 10:13

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Scott Robison
On Thu, Nov 26, 2015 at 11:42 PM, Igor Korot wrote: > Hi, Scott, > > On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison > wrote: > > On Thu, Nov 26, 2015 at 10:13 PM, Igor Korot wrote: > >> > >> Hi, > >> Is there any way to have "sqlite3_errmsg" function return a wide char > > string? > >> Or do a

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread J Decker
On Fri, Nov 27, 2015 at 12:17 AM, Scott Robison wrote: > On Thu, Nov 26, 2015 at 11:42 PM, Igor Korot wrote: > >> Hi, Scott, >> >> On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison >> wrote: >> > On Thu, Nov 26, 2015 at 10:13 PM, Igor Korot wrote: >> >> >> >> Hi, >> >> Is there any way to have

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Igor Korot
Hi, Is there any way to have "sqlite3_errmsg" function return a wide char string? Or do a conversion in a portable way? Thank you.

[sqlite] sqlite3_errmsg and wide char

2015-11-26 Thread Scott Robison
On Thu, Nov 26, 2015 at 10: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? > > Thank you. The portable way would be to use the mbstowcs function from stdlib.h, though it depends on what