PHP/MySQL does unicode? Query not working...

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Puritan

Thread Starter
Joined
Feb 14, 2001
Messages
242
Hi, I'm converting pages from ASP and (I think) MSSQL to PHP and MySQL... the database stores a lot of Korean data that worked in the original, but not in the new version. For example, there was a query:

SELECT Name, Duty from ProfileMember where UNICODE(Left(Name, 1)) >= " & indexKeyword(intKeyword) &" and UNICODE(Left(Name, 1)) < " & indexKeyword(intKeyword + 1) & " ORDER BY Name"

indexKeyword is a predefined array of Unicode values that determines what names we show on each page.

Anyway, there is no UNICODE() function in MySQL, so far as I know, so I'm wondering how to replicate this functionality. I tried using ORD(Name), which is supposed to return the first character, even if it's stored in multi-byte format, but it doesn't work the way it should. (From trial and error, all of the names stored have Ords under 200 or so, whereas the original Unicode encodings are 44032, 45208, 45796, etc.) Not only that, but if I get rid of the Ord requirements altogether and just tell them to bring back all the records sorted by Name, the results do not get properly sorted. (They are sorted to some fashion, i.e. if I tell it to reverse the sorting, they come back in reverse order, but it's not Korean alphabetical, i.e. Unicode-sorted, that's for sure.)

Anyone know how to make this work? Thanks.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top