Here's what I did for the last four hours...
I'm working on my
favorite project to make it compatible with
MySQL 5.0 (which for some reason has several incompatibilities with the previous version) and I run into a weird bug when inserting Unicode strings. The project supports both Microsoft SQL Server and MySQL, so I use the
N'...' syntax to encode Unicode strings.
According to the
documentation, that should be fine, but of course it is not. The documentation says that these two statements are equivalent:
SELECT N'some text';
SELECT _utf8'some text';
At least when using Connector/Net, that does not seem to be true. When
inserting values into a UTF8 column, the following statements yield different
results:
INSERT INTO test VALUES (N'\\'); -- inserts two backspaces
INSERT INTO test VALUES (_utf8'\\'); -- inserts only one
Even worse:
INSERT INTO test VALUES (N'Côte d\'Ivoire'); -- syntax error
INSERT INTO test VALUES (_utf8'Côte d\'Ivoire'); -- works
For now I'm waiting to see what the response to my
bug report will be - perhaps it's not a bug after all, but a feature...