Extent passing string to database with utf8 encoding results in invalid chars
Posted by: Sven Bisaro
Date: March 16, 2005 05:55AM

This is the code that I use to insert the value in the test database:

string connectionString ="Database=monkey; Data Source=localhost;

UserId=<user>; Password=<pwd>; CharSet=utf8";

MySqlConnection con=new MySqlConnection(connectionString);

con.Open();

string sql="insert into tbl_monkey(monkey_name) values('ä')";

MySqlCommand cmd = new MySqlCommand(sql,con);

cmd.ExecuteNonQuery();

con.Close();

This is the result:

+--------------+-------------+
| pk_monkey_id | monkey_name
+--------------+-------------+
| 1 | Σ |
| 2 | Σ |
| 3 | Σ |
+--------------+-------------+

Can someone indicate how I can get ä into my database?

Thanks
Sven

Options: ReplyQuote


Subject
Views
Written By
Posted
Extent passing string to database with utf8 encoding results in invalid chars
3121
March 16, 2005 05:55AM
2693
March 23, 2005 08:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.