Re: [sqlite] SQLite - macOS

2019-09-23 Thread Jens Alfke
> On Sep 23, 2019, at 9:53 AM, Pierre Clouthier > wrote: > > sqlite3_exec("PRAGMA encoding = \"UTF-8\";") That isn't necessary. SQLite defaults to UTF-8. In most cases SQLite doesn't interpret the byte sequences in a string. It just knows it's using an 8-bit character set and leaves it

Re: [sqlite] SQLite - macOS

2019-09-23 Thread Richard Damon
> On Sep 23, 2019, at 1:25 PM, Simon Slavin wrote: > >> On 23 Sep 2019, at 5:53pm, Pierre Clouthier >> wrote: >> >> Can anyone explain how to write UTF-8 in SQLite on the Mac? >> >> We use this statement: >> >> sqlite3_exec("PRAGMA encoding = \"UTF-8\";") > > This is not a SQLite

Re: [sqlite] SQLite - macOS

2019-09-23 Thread Igor Korot
Hi, On Mon, Sep 23, 2019 at 11:58 AM Pierre Clouthier wrote: > > Can anyone explain how to write UTF-8 in SQLite on the Mac? > > We use this statement: > > sqlite3_exec("PRAGMA encoding = \"UTF-8\";") You should probably use this inside #ifdef _WINDOWS #endif Thank you. > > This

Re: [sqlite] SQLite - macOS

2019-09-23 Thread Simon Slavin
On 23 Sep 2019, at 5:53pm, Pierre Clouthier wrote: > Can anyone explain how to write UTF-8 in SQLite on the Mac? > > We use this statement: > > sqlite3_exec("PRAGMA encoding = \"UTF-8\";") This is not a SQLite problem, but a problem with escaping the quotes in language you're using to

Re: [sqlite] SQLite - macOS

2019-09-23 Thread Richard Damon
Not sure what you code is doing, and you aren’t showing how you are getting your 'é' into SQLite, but U+FFFD is the standard character for malformed data, so something somewhere is complaining about converting something into UTF-8. Also, you CAN’T have a UTF-8 value like 0xC3A9, as that is not

[sqlite] SQLite - macOS

2019-09-23 Thread Pierre Clouthier
Can anyone explain how to write UTF-8 in SQLite on the Mac? We use this statement: sqlite3_exec("PRAGMA encoding = \"UTF-8\";") This works fine on Windows, but on macOS the data is not being stored correctly. The data to be written (passed to SQLite), is formatted in UTF-8. For