Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
« Previous Thread | Next Thread » Featured Thread Featured Thread  
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 28th, 2006, 01:16 PM
phpweb phpweb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 251 phpweb User rank is Private First Class (20 - 50 Reputation Level)phpweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 Days 18 h 21 m 14 sec
Reputation Power: 5
Is this not possible? To get correct sorting with UTF8 database and Norwegian chars?

I'm using PHP 5.2 and firebird 2.0.

Have created a database like this:

CREATE DATABASE 'localhost:c:/ibase/ONFIRE.FDB' user 'SYSDBA' password 'secret' DEFAULT CHARACTER SET UTF8;

So when I create the character fields in database their charset are UTF8.

Then I insert some records, some with the chars æøå and some without.

The records are in the table and they are displaying correct in HTML.

But when I want to sort the the content in the table like this:

select PAG_ID,PAG_NAME from pager where lower(PAG_NAME) like 'a%' order by lower(PAG_NAME) collate UCS_BASIC

or like this

select PAG_ID,PAG_NAME from pager where lower(PAG_NAME) like 'a%' order by lower(PAG_NAME) collate UNICODE

the sort order for the records containing æøå is not correct:
It is like this:
Aå cool site
Aæ cool site
Aø cool site

But should have been like this:
Aæ cool site
Aø cool site
Aå cool site

I want to have the database in UTF8.

I want to be able to sort correctly whatever language using a proper collation.....

Is it not possible?

(I have a bad feeling that I have to use another charset for the database, since there are no other collations to use than UNICODE and UCS_BASIC for the UTF8 charset.)


Doing the "same" in MySQL, ORACLE and it works like a charm.
Would really make this work in Firebird as well.
__________________
BongoBongo

Reply With Quote
  #2  
Old November 29th, 2006, 11:45 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,905 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 4 h 58 m 14 sec
Reputation Power: 279
Did you also set the collation?

This should also solve your upper() problem

Reply With Quote
  #3  
Old January 11th, 2007, 08:05 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,905 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 4 h 58 m 14 sec
Reputation Power: 279
Check the PDF document inside this zip file from the Fourth International Firebird Conference it contains all the details

Reply With Quote
  #4  
Old January 11th, 2007, 08:26 AM
phpweb phpweb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 251 phpweb User rank is Private First Class (20 - 50 Reputation Level)phpweb User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 Days 18 h 21 m 14 sec
Reputation Power: 5
Hi Pabloj

Just downloaded the files, have not read it yet though.

Thanks for taking the time to give me these docs.


Reply With Quote
  #5  
Old January 11th, 2007, 09:03 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,905 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 4 h 58 m 14 sec
Reputation Power: 279
Hope it helps

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Is this not possible? To get correct sorting with UTF8 database and Norwegian chars?


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