Re: [pysqlite] Trouble with create_function interface to sqlite
Roger Binns <[email protected]> Thu, 29 May 2008 04:45:00 -0700
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Eric S. Johansson wrote: > err um, utf-8 *is* unicode. > > http://en.wikipedia.org/wiki/UTF-8 UTF-8 is an encoding of Unicode. It is a way of expressing Unicode as bytes. The Unicode standard itself merely defines codepoints. They look like U+0041 for the letter A. In order to express the codepoints in byte form you need an encoding such as UTF-8, UCS-2, UTF-16, UCS-4 etc. People do use Unicode and UTF-8 interchangeably since in many cases the distinction doesn't matter, but in the case of SQLite 3 it does. SQLite 3 operates on Unicode strings and will accept and provide them in UTF-8 and UTF-16 byte encodings in the various apis. That is all transparent and independent of what encoding SQLite uses for the file. But if you do provide invalid data, one of those behind the scenes conversions can later easily end up biting you as well as functionality such as functions and collations. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIPpc8mOOfHg372QQRAiL3AJ9tAUqRbtXvZYz2g2EYEB8z+lQN3ACeMzVb TE4Ey9x1N0+uo93DNxAgSGo= =aunr -----END PGP SIGNATURE-----