MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old September 2nd, 2003, 01:34 AM
mruhul mruhul is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 48 mruhul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 6 h 59 m 4 sec
Reputation Power: 6
Unhappy japanese character sorting

Hi all,

In my mysql database i have stored accounts name in japanese character. All accounts has been displayed in a page sort by name. So i use "ORDER BY name" in my query. But my client complain that the names are not sorted correctly.

Is there anything i have to do in case of japanese or non-english character sorting? please help....

thanks in advance.
__________________
ruhul

Reply With Quote
  #2  
Old September 2nd, 2003, 04:52 PM
HarrisonF HarrisonF is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2002
Location: Binghamton, NY
Posts: 536 HarrisonF User rank is Sergeant (500 - 2000 Reputation Level)HarrisonF User rank is Sergeant (500 - 2000 Reputation Level)HarrisonF User rank is Sergeant (500 - 2000 Reputation Level)HarrisonF User rank is Sergeant (500 - 2000 Reputation Level)HarrisonF User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 15 h 35 m 55 sec
Reputation Power: 19
It will depend on which character set you are using.
Prior to MySQL 4.1 you can only specify the character set for the entire server. To do so you use the --default-character-set option. For japanese you would most likely want sjis or ujis. So in your config file you could use:
Code:
[mysqld]
default-character-set=sjis

In MySQL 4.1 you can now specify both character set and collation down to the column level (More complete than most RDBMSs). To read more about that check out http://www.mysql.com/doc/en/Charset.html

Reply With Quote
  #3  
Old November 7th, 2004, 10:02 AM
macgruder's Avatar
macgruder macgruder is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Japan
Posts: 251 macgruder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 54 sec
Reputation Power: 8
Resurrecting this topic. I think the problem here is more than one of just collation. There is no way to easily order Japanese unless your characters are all in kana (hiragana or katakana).

A simple case:
Suppose you have the Kanji

nihon (??)
hi (day - ??)

There is no way for mysql to know whether the kanji for day is read 'hi' or 'ni' etc and so it can't order them. On the other hand, if you are ordering kana, you can go with the previous suggestion.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > japanese character sorting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway