I'm trying to populate a table with Chinese characters using a C# console program. The characters are perfectly preserved in the C# string, but when I want to execute the query with:
cmd.ExecuteNonQuery();
It basically creates a conversion problem. I have been looking around on the net and found out that it has to do with the console encoding. So I tried changing it this but it doesn't work.
Console.InputEncoding = Encoding.UTF8;
Console.OutputEncoding = Encoding.UTF8;
Query before execution:
INSERT INTO Sentences (cat, q, a)
VALUES ('English -> Chinese; HSK level 1; limited 1; part 1','He caught a cold. ;;; tā gǎn mào le。','他感冒了。')
INSERT in table:
English -> Chinese; HSK level 1; limited 1; part 1
He caught a cold. ;;; ta gan mào le?
?????
Direct query in phpmyadmin gives the desired result, so it's not a table encoding issue.