locked
Problems with mysql connector/net and character encoding RRS feed

  • Question

  • hello all, i have my table and column set to encoding utf8, however i've inserted into my table the char µ and when i select * from table it shows fine but in asp .net doing a read and reader.GetString("column") is returning a æ instead of µ. I've added CharSet=utf8 to my connection string but still no dice. Here is a snippet of code that does the read

     

    using(MySqlDataReader lReader = new MySqlDataReader("SELECT * FROM WebsiteContent WHERE PageID = 2", lCOnnection))
    {
    while(lReader.Read())
    {
            string lPageContent = lReader.GetString("Content");
    }
    }

     

    lPageContent contains an æ instead of µ, any help in this matter would be appreciated.

    Thursday, April 21, 2011 12:34 PM

Answers

  • Hello, you can try to set the charset in the connection string:

    CharSet=UTF8

    Hope this helps,

    Miguel.

     

    Monday, April 25, 2011 1:23 AM

All replies

  • Hello, you can try to set the charset in the connection string:

    CharSet=UTF8

    Hope this helps,

    Miguel.

     

    Monday, April 25, 2011 1:23 AM
  • Any progress with Miguel's suggestion?
    If not please post your thread in the official community of MySQL to seek suggestions as related topics are off-topic here in the current forum. Then I will move your thread into the Off-Topic Forum shortly. Thanks for your understanding.
    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 25, 2011 3:50 AM