[Solar-talk] UTF-8

Rodrigo Moraes rodrigo.moraes at gmail.com
Mon Jul 17 19:20:24 PDT 2006


On 7/17/06, Paul M Jones wrote:
> Do you know how to do that for the four databases Solar currently
> supports?  MySQL probably not hard, but it needs to cover Sqlite,
> Postgres, and MS-SQL too.

Some notes:
MySQL
    "CREATE TABLE ... CHARACTER SET utf8 COLLATE utf8_general_ci"
This is important: "pdo doesn't care about charsets. if you want to
have your connection in unicode / utf-8 or any other encoding, you'll
have to tell your database, for example using $pdo->exec('SET
CHARACTER SET utf8') (mysql)." [1]

(I understood that you must set the charset after connect to a MySQL
database, besides defining it in CREATE TABLE.)

PostgreSQL
    "CREATE DATABASE ... WITH ENCODING 'UTF8'" [2]
    $pdo->exec("SET CLIENT_ENCODING TO 'UTF8'");

MS-SQL
"MS Access and MS SQL Server use UTF-16 as their native format" [3]
Googling for it, I haven't found more clues.

SQLite
No clues, again. But this is at least easier to test.

regards,
rodrigo moraes / brazil

[1] http://br.php.net/manual/en/ref.pdo.php#68103
[2] http://www.postgresql.org/docs/8.1/static/multibyte.html
[3] http://www.johanvanmol.org/content/view/34/37/1/2/


More information about the solar-talk mailing list