Jump to content

MySQL functions do not read multibytes properly


yosibeck

Recommended Posts

Believe me, I have searched, googled and read dozens of articles on the web, but my problem persists.My database is utf-8 encoded. Indeed the items that are retrieved from the database are properly displayed as utf-8 by the browser.In other words - my problem is NOT display of utf=8 encoded database items by the browser. That works just fine.My problem is that INTERNALLY mysql functions that should be "multibyte safe" just aren't.I have a database in Persian. All items are properly utf-8 encoded.If I do a SUBSTRING(foo,1,1) on one of the utf-8 encoded database items, instead of taking the first (two-byte) Persian character, MySQL's SUBSTRING sees the first byte of the 2-byte character and displays it as if it were a one byte Latin character.Again, if I just retrieve $foo from the database and display it on the screen it looks great.But any internal manipulation by a MySQL query of the same items fails because multibytes are not recognized as such.In PHP there is the special set of mbstring string functions to tackle this, but I can't find anything similar for MySQL.Any suggestions - please?Thanks.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...