Support Forums

UTF8 sort order

This is a discussion on UTF8 sort order within the Technical Support forums, part of the Technical Support Forums category; What version of 68 Classifieds are you running? V4.1.8 Designer What template are you using? Deepsea Please describe in detail ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

Reply
 
Thread Tools Display Modes
Old 01-15-2010, 02:51 PM   #1
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 10
jonten123 is on a distinguished road
Default UTF8 sort order

What version of 68 Classifieds are you running?
V4.1.8 Designer

What template are you using?
Deepsea

Please describe in detail the issue you are having:

Hello,

Åäö looks like they should now in my database but they are not sorted correctly on my site. Ä comes after A and Ö comes after O. They should come after Z likes this zåäö. I have read about this on google and it seems to be utf8_general_ci that causes this issue. I have edited every table to utf8_unicode_ci but that did not help. I then read that the database was probably created with the incorrect sort order and that the solution would be to create a new database with the correct sort order. I just created a new database and changed the collation to ut8_unicode_ci on it before I installed, but every table in it is created as utf8_general_ci. Is it possible to have them created with utf8_unicode_ci instead? Somebody stated this in a post on another forum board "The issue you describe with sorting of letters like that is one of the main differences between general_ci and unicode_ci, unicode_ci should correct those sorting issues."

Thanks!
jonten123 is offline   Reply With Quote
Old 01-15-2010, 03:10 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

The databases default Collation is set by the my.cfg ile which is server wide and under control of your host. All database are usually created using the default collation specified in that file. However, you should be able to go into phpmyadmin, chose the database that you you use for 68C, chose the "Operations" tab and then on that page you should be able to select a new collation and hit the go button to apply that change.

Im guessing you would want to do that before installing 68C into that database.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-15-2010, 03:23 PM   #3
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 10
jonten123 is on a distinguished road
Default

Hello,

That´s exactly what I did. Changed it under operations before installing. The database was created with latin1_swedish.ci, so I changed from that to utf8_unicode_ci before installing. Could it be latin1_swedish_ci that causes this issue? It does not sound wrong with latin1_swedish_ci since åäö is the swedish alphabet....
jonten123 is offline   Reply With Quote
Old 01-15-2010, 03:36 PM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Your best bet may be to contact your host and see if they have a recomendation.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-15-2010, 04:26 PM   #5
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 10
jonten123 is on a distinguished road
Default

My host gave me a link to this site PHP: readdir - Manual and points me to MetaNull's post where he runs iconv( "iso-8859-1", "utf-8", $file ); and says that it could be something similar that I have to do. I don´t really have a clue where I shall put that line of code....
jonten123 is offline   Reply With Quote
Old 01-19-2010, 07:06 AM   #6
Member
 
Join Date: Dec 2009
Posts: 53
Rep Power: 10
jonten123 is on a distinguished road
Default

I got the sort order working now but I just read this on php.net "Note: This is the preferred way to change the charset. Using mysqli::query() to execute SET NAMES .. is not recommended."

I changed $this->query("set names utf8") to $mysqli->set_charset("utf8") in the mysql file but the page is not working with the new code. I don´t really understand why it is not recommended to use set_names. What are the benefits of using $mysqli->set_charset("utf8")?

Thanks!

Last edited by jonten123; 01-19-2010 at 07:10 AM.
jonten123 is offline   Reply With Quote
Old 01-19-2010, 09:35 AM   #7
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 136
Eric Barnes is just really nice Eric Barnes is just really nice
Default

The mysqli is for the MySQL Improved Extension which we currently do not use in the code.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change default Sort Order nagrap2 Customizations 2 01-04-2010 04:44 PM
Filter module locations sort order jonten123 TemplateCodes 1 01-03-2010 09:51 PM
Extrafield Sort Order wendel18 Technical Support 1 08-08-2009 10:05 PM
Full UTF8 support redking Technical Support 1 07-24-2009 11:27 PM


All times are GMT -4. The time now is 05:51 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0