MySQL Forums
Forum List  »  Newbie

The MySQL .net Drivers doesn't support Chinese
Posted by: Juliau Gong
Date: September 12, 2004 02:48AM

I use the MySQL .net 1.0.0 beta, but found that it doesn't support Chinese, can't display Chinese normally, and found that the drivers Encoding is always UTF8, I found that it's a bug in ConnectionInternal.Configure()

if (! driver.Version.isAtLeast(4,1,0))
{
if (props.Contains( "character_set" ))
charSet = props["character_set"].ToString();
}
else
{

charSet = "utf8";
cmd.CommandText = "SET character_set_client = utf8";
cmd.ExecuteNonQuery();
}

if (charSet != null)
driver.Encoding = CharSetMap.GetEncoding( charSet );
else
throw new MySqlException("Unknown text encoding. Aborting!");
}


the "if (props.Contains( "character_set" ))" row may be wrong, because mysql doesn't have a variable named "character_set", then the driver's encoding is always UTF8.

Options: ReplyQuote


Subject
Written By
Posted
The MySQL .net Drivers doesn't support Chinese
September 12, 2004 02:48AM


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.