Multibyte character problem with MySQL database

This is a place to discuss how to adapt mojoPortal to the needs of different cultures. Before asking questions here please first review the localization documentation.

This thread is closed to new posts. You must sign in to post in the forums.
11/8/2007 7:16:34 PM
Gravatar
Total Posts 2

Multibyte character problem with MySQL database

There is a problem when I use mojoPortal in Japanese with MySQL database. The error occurs if the multibyte characters of three or more (example “日本語”) is input to content of the Blog, the Forums, the Event Calender, etc. The error message is as follows. The same problem occurs also on the demo site of mojoPortal (http://demo.mojoportal.com/) and current version 2.2.3.9.


mojoPortal:code from svn(version 2.2.4.0)
MySQL Version:5.0.45

Error Message
Details of exception: MySql.Data.MySqlClient.MySqlException: Incorrect string value: '\xE8' for column 'Excerpt' at row 1

source error:

line 518: arParams[6].Value = allowCommentsForDays;
line 519:
line 520: int rowsAffected = MySqlHelper.ExecuteNonQuery(
line 521: GetConnectionString(),
line 522: sqlCommand.ToString(),

source file: G:\Visual Studio 2005\WebSites\mojopotalsvn\mojoPortal.Data.MySql\dbBlog.cs line: 519

DbType of column “Descriptin” is Text. When the 508th line of dbBlog.cs change from “MySqlDbType.Blob” to “MySqlDbType.Text”, it is possible to input multibyte characters normally.

te

11/8/2007 7:26:45 PM
Gravatar
Total Posts 2

Re: Multibyte character problem with MySQL database

The error occurs like this if Japanese is input.

There is a problem when I use mojoPortal in Japanese with MySQL database. The error occurs if the multibyte characters of three or more is input to content of the Blog, the Forums, the Event Calender, etc. The error message is as follows. The same problem occurs also on the demo site of mojoPortal (http://demo.mojoportal.com/) and current version 2.2.3.9.


mojoPortal:code from svn(version 2.2.4.0)
MySQL Version:5.0.45

Error Message
Details of exception: MySql.Data.MySqlClient.MySqlException: Incorrect string value: '\xE8' for column 'Excerpt' at row 1

source error:

line 518: arParams[6].Value = allowCommentsForDays;
line 519:
line 520: int rowsAffected = MySqlHelper.ExecuteNonQuery(
line 521: GetConnectionString(),
line 522: sqlCommand.ToString(),

source file: G:\Visual Studio 2005\WebSites\mojopotalsvn\mojoPortal.Data.MySql\dbBlog.cs line: 519

DbType of column “Descriptin” is Text. When the 508th line of dbBlog.cs change from “MySqlDbType.Blob” to “MySqlDbType.Text”, it is possible to input multibyte characters normally.

teku

11/9/2007 5:04:18 AM
Gravatar
Total Posts 18439

Re: Multibyte character problem with MySQL database

Hi teku,

Thanks for letting me know about this. Its always nice when someone provides the solution along with the problem. I will go through the MySql data layer today and anywhere we are using blob for text I will change it.

btw, if you happen translate the Resource file(s) to Japanese it would be wonderful if you could contribute the translation to the project.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.