/    Sign up×
Community /Pin to ProfileBookmark

How can i Sort with accents?

My prob is, when i put my table to sort for name (alphabetical order), it doesnt count the words with accents, it sort all normal but the words with accents came in the end of that letter like this:

i have the words with M

Mike
Mongrell
Mário

“mário” should be first than the others but cause of the accent it came in last.

what i need is something that can order normaly with accents too

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 21.2009 — If we're talking about a database query sort, what collation type is that column using?
Copy linkTweet thisAlerts:
@GutoFariaauthorApr 22.2009 — well the table is a javascript, and it interacts with a database
Copy linkTweet thisAlerts:
@bejitto101Apr 22.2009 — I think what NogDog was asking was what was the collation the database is using. If you go into your database with phpMyAdmin, or whatever your manager is, and look at the structure of your database table, it should display the collation for each field. Something like "latin1_german2_ci". He was asking what it was for your database.
Copy linkTweet thisAlerts:
@GutoFariaauthorApr 22.2009 — well, the thing is, im using linux, and as i said the table is in javascript, its an object, so i think i might have to chnage the object in order to sort with the accents ?
Copy linkTweet thisAlerts:
@NogDogApr 22.2009 — Where is the actual sorting done: JavaScript, PHP, a database query, or somewhere else? We cannot figure out how to fix the sorting without knowing how it's currently being done. If it can be done at the database level, that may be the easiest place to deal with it as it may only be a matter of specifying an appropriate character collation (e.g. utf8-general-ci in MySQL). Doing the sort in PHP may be more of an issue as it does not "play well" with multi-byte character sets (at least not until PHP6 is ready, hopefully) and may require more work to get it to sort the way you want (perhaps utilizing the [url=http://www.php.net/mbstring]mbstring[/url] extension).

If the sorting is done at the JavaScript level, then this should probably be moved to the JavaScript forum.
Copy linkTweet thisAlerts:
@GutoFariaauthorApr 22.2009 — yeah i think it is the javascript, cause the table is an object...

well thx for your time ?
×

Success!

Help @GutoFaria spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...