Last post Aug 30, 2013 06:36 AM by Silverlight.Shailendra
Aug 15, 2010 09:54 AM|abhigan|LINK
I have an asp.net site that stores user messages in a mysql db, now the problem is if the user inserts any indic (hindi and other indian languages) text in the database it isn't displaying in the message board and it renders like ??? ???? ??? or other symbols.
Aug 15, 2010 10:50 AM|mbanavige|LINK
by default, your webpage will render as UTF8. so you'll want your db to also use UTF8
to see if they help.
Aug 15, 2010 11:30 PM|abhigan|LINK
Well I am not using PHP and I do not have any knowledge of it. I'm using MySql DB and ASP.NET (VB as codebehind) .
Now review this code...
Dim MySqlCommand As New OdbcCommand("", MySqlConnection)
MySqlCommand.CommandText = "SET character_set_results=utf8"
MySqlCommand.CommandText = "SET NAMES utf8"
MySqlCommand.CommandText = "SET character_set_client=utf8"
MySqlCommand.CommandText = "SET character_set_connection=utf8"
MySqlCommand.CommandText = "SET collation_connection=utf8_general_ci"
MySqlCommand.CommandText = "Select `MB`.*,`UM`.`FirstName`,`UM`.`LastName`,`UM`.`PhotoURL`,`UM`.`PhotoEXT` From `database_name`.`table_name` as `MB`, `database_name`.`table_name` as `UM` where `UM`.`UUID`=`MB`.`UUID` and `MB`.`touuid`='" & Request.QueryString("UUID").Trim & "' Order By `MB`.`msgtime` DESC"
Dim dt As New DataTable
Dim da As New OdbcDataAdapter(MySqlCommand)
But still I get ????? ?? ???? in the page. I have altered the table and set the character set to utf8 and schema collaion to utf8 but good for nothing
Sep 05, 2010 05:24 AM|abhigan|LINK
the problem is solved
Jan 05, 2011 11:41 AM|amitsonkhiya|LINK
can you tell me how you did it? i m facing the same.
Jan 05, 2011 11:28 PM|abhigan|LINK
In MySql we have to specify the collation at the time of creating the database (schema) if you specify the utf8 default collation hen you'll be able to do it.
Step1. Create a new database (schema) with utf8 default collation as your collation
Step 2. Create new tables with the same collation
Step3. Create fields in table with the same collation
and that's it.
Aug 30, 2013 06:36 AM|Silverlight.Shailendra|LINK
I am also facing the same problem. I did all the things but the problem is not resolved