Re: [sqlite] UTF-16 API a second class citizen?

2009-04-08 Thread Igor Tandetnik
"Vinnie" wrote in message news:621704.45397...@web58202.mail.re3.yahoo.com > To be honest, thinking about character > encodings gives me a large headache "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Scott Hess
On Tue, Apr 7, 2009 at 7:04 PM, Vinnie wrote: > On the other hand there is some legacy data that I want to store > using UTF-8. For these fields I will use sqlite3_bind_text(). It is > possible that in a single INSERT statement there are both UTF-16 > and UTF-8 (wchar_t and

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Nicolas Williams
On Tue, Apr 07, 2009 at 08:28:24PM -0700, Vinnie wrote: > > > Note that both UTF-8 and UTF-16 are capable of representing > > the full range of Unicode characters. Conversion between the two is > > lossless. You seem to be under impression that UTF-8 is somehow > > deficient, only suitable for

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Vinnie
> Note that both UTF-8 and UTF-16 are capable of representing > the full range of Unicode characters. Conversion between the two is > lossless. You seem to be under impression that UTF-8 is somehow > deficient, only suitable for "legacy" encoding. This is not the > case. Yeah thats what they

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Igor Tandetnik
"Vinnie" wrote in message news:320060.55321...@web58204.mail.re3.yahoo.com > However, I have table fields which will be UTF-16. For example, > filenames that have to support international character sets. Or > metadata fields that use different character sets (UNICODE). For >

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Bill KING
Vinnie wrote: > PRAGMA statements, I see what you mean now. This is exactly what I needed, > thanks a lot. > > To clarify what I am doing, my SQL statements are in UTF-8 and they are all > prepared, with parameter bindings. So table names, column names, etc.. are > all UTF-8. > > However, I

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Vinnie
PRAGMA statements, I see what you mean now. This is exactly what I needed, thanks a lot. To clarify what I am doing, my SQL statements are in UTF-8 and they are all prepared, with parameter bindings. So table names, column names, etc.. are all UTF-8. However, I have table fields which will

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Bill KING
Igor Tandetnik wrote: > You can mix and match encodings in your application. The database > encoding determines how strings are actually stored in the file (and > it's database-wide, not per table). SQLite API converts back and forth > as necessary. > Very inneficiently, but yes, it does. I

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Igor Tandetnik
Vinnie wrote: >> From: "Igor Tandetnik" >> You could convert your file name from UTF-16 to UTF-8, then >> call sqlite3_open_v2. > > Converting the file name is no problem. But I thought that depending > on how you opened the database (open16 versus

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Vinnie
> From: "Igor Tandetnik" > You could convert your file name from UTF-16 to UTF-8, then > call sqlite3_open_v2. Converting the file name is no problem. But I thought that depending on how you opened the database (open16 versus open_v2), SQL treats your strings

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Eric Minbiole
> Dear Group: > > When my application launches I want to open the associated database, and if > that fails because the file does not exist then I would create a new > database. > > sqlite3_open_v2() is ideal for this purpose because you can leave out > SQLITE_OPEN_CREATE flag, and specify

Re: [sqlite] UTF-16 API a second class citizen?

2009-04-07 Thread Igor Tandetnik
Vinnie wrote: > Unfortunately, this is all academic because I am using > sqlite3_open16()! Where is the UTF-16 version that accepts the flags > as a parameter? How can I achieve the same functionality? You could convert your file name from UTF-16 to UTF-8, then call