I'm running Dblinq against a Mysql 5.0 database, and used dbmetal to
generate the wrapping class to the database.  The database tables were
created with default charset=utf8, however the strings being returned
from varchar columns are being encoded with the latin1 (cp1252)
encoding a opposed to utf8, so byte sequences such as 0xe2, 0x80, 0x99
are showing up as ’ instead of the right single quotation mark  ’ .
I've updated all the character set variables I'm aware of in MySql to
utf8.  The database itself was created with latin1 as the character
set, but as I mentioned above, the tables themselves were created with
default charset utf8.

mysql> SHOW VARIABLES LIKE '%character_set%';
+--------------------------+-------------------
| Variable_name            | Value
+--------------------------+-------------------
| character_set_client     | utf8
| character_set_connection | utf8
| character_set_database   | latin1
| character_set_results    | utf8
| character_set_server     | utf8
| character_set_system     | utf8


I'm working around the issue for now by re-encoding the strings as
follows:

  string sEncValue = Encoding.UTF8.GetString(Encoding.GetEncoding
(1252).GetBytes(sOrigValue));

but am wondering if there's a better, more basic solution (perhaps
some configuration I haven't done).

--

You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/dblinq?hl=.


Reply via email to