Skip navigation links

MySQL Forums


Advanced Search

problem while inserting special characters
Posted by: shashank shekhar ()
Date: October 12, 2009 01:54PM

Hi,

I am facing this issue if I insert a special character in the db.
I am using Mysql db version 5.0.51b and .net connector 5.2.7. I have a table with a varchar column with charset as utf8 and column collate as utf8_general_ci and I am using stored procedures to insert data. When I inserted a string with special character '√' , it got saved as '?' in the database.
So, I added charset=utf8 in the connection string and used the following code to encode the string as utf8 before inserting:

UTF8Encoding utf8 = new UTF8Encoding();
Byte[] encodedBytes = utf8.GetBytes(question.QuestionText);

But this saved the special character '√' as '√' .
I tried executing the query "SET NAMES UTF8" before performing insert, but even that didn't help.
What is that I am doing wrong?

Regards,
Shashank

Options: ReplyQuote


Subject Written By Posted
problem while inserting special characters shashank shekhar 10/12/2009 01:54PM


Sorry, only registered users may post in this forum.