yosibeck Posted April 21, 2010 Share Posted April 21, 2010 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 More sharing options...
justsomeguy Posted April 21, 2010 Share Posted April 21, 2010 That sounds like the discussion here, they talk about using SET NAMES as a solution:http://bugs.mysql.com/bug.php?id=31242Sounds like a weird set of default behavior to me, what you're seeing I guess is technically correct, although it doesn't really make sense to do it that way. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.