16 messages in com.mysql.lists.win32Re: Problem with sorting scandinavian...| From | Sent On | Attachments |
|---|---|---|
| Bjarte Husebø | 01 Jun 2000 06:10 | |
| Sinisa Milivojevic | 01 Jun 2000 06:35 | |
| Bjarte Husebø | 02 Jun 2000 07:08 | |
| miguel solórzano | 02 Jun 2000 09:44 | |
| Jani Tolonen | 03 Jun 2000 16:50 | |
| Bjarte Husebø | 04 Jun 2000 12:30 | |
| Jani Tolonen | 05 Jun 2000 07:53 | |
| Bjarte Husebø | 05 Jun 2000 10:48 | |
| Jani Tolonen | 06 Jun 2000 06:28 | |
| Regis Bossut | 06 Jun 2000 09:27 | |
| Jani Tolonen | 06 Jun 2000 11:51 | |
| webm...@accessinter.net | 06 Jun 2000 13:47 | |
| Jonah H. Harris | 06 Jun 2000 14:15 | |
| Sinisa Milivojevic | 07 Jun 2000 06:18 | |
| Regis Bossut | 07 Jun 2000 07:44 | |
| sin...@mysql.com | 07 Jun 2000 10:35 |
| Subject: | Re: Problem with sorting scandinavian characters![]() |
|---|---|
| From: | Jani Tolonen (ja...@mysql.com) |
| Date: | 06/06/2000 11:51:16 AM |
| List: | com.mysql.lists.win32 |
Hi Bjarte,
I didn't know it originally, but Danish and Norwegian has alphabets sorted same way, which is different from Finnish and Swedish. I mentioned about this in my previous mail.
We do have character set for Danish (named "danish.conf")
With MySQL 3.23 version you can change the character set when you start MySQL server like:
mysqld.exe --default-character-set=danish
I checked differencies with danish and latin1 and the only things that are sorted differently are Æ,Ä,Ø,Ö and Å.
So you should use that character set.
Regards,
- Jani
+---------------------------------------------------------------+ | TcX ____ __ _____ _____ ___ | | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Jani Tolonen | | /*/ /*/ /*/ \*\_ |*| |*||*| mailto:ja...@mysql.com| | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Helsinki | | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ Finland | | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^ | | /*/ \*\ Developers Team | +---------------------------------------------------------------+
Jani Tolonen writes:
Bjarte Husebø writes:
----- Original Message ----- From: "Jani Tolonen" <ja...@mysql.com> To: "Bjarte Husebø" <bja...@bbb.no> Cc: <win...@lists.mysql.com>; <mon...@mysql.com>; <sin...@mysql.com> Sent: Monday, June 05, 2000 4:54 PM Subject: Re: Problem with sorting scandinavian characters
Bjarte Husebø writes:
On Thu, 01 Jun 2000, Bjarte Husebø wrote:
I'm testing out MySQL 3.22.34-shareware-debug version, and have detected a problem when sorting scandinavian characters (ÆÄØÖÅ). Is this a bug in the shareware version, or a wrong/missing setting somewhere in the ini-file? My OS is Windows 2000 Professional.
(snip)
Jani Tolonen wrote:
What character set is the one that you are using?
Is it one of these:
big5, cp1251, cp1257, czech, danish,dec8, dos, euc_kr, gb2312, gbk, german1, hebrew, hp8, hungarian, koi8_ru, koi8_ukr, latin1, latin2, sjis, swe7, tis620, ujis, usa7, win1251 or win1251ukr
or something else?
In MySQL 3.23 you can change the current character set with mysqld --default-character-set=... The alternatives you can find from SHAREDIR/charsets/Index
With MySQL 3.22 one has to compile the wanted character set in. In Windows versions this is Latin1.
Hi Jani,
I haven't changed anything regarding character sets, so I guess it's Latin1 (MySQL 3.22). But the actual sort order may indicate that this is not the case. I have tried both at the command prompt (with DOS characters), and via ODBC to MS Access (with Windows/Ansi character set).
Maybe I should try to buy a registered Win32 version, if that is a higher version (3.23)? But preferably, I would like to see this work before I go ahead and spend some money.
-Bjarte-
Hi Bjarte,
Here are the characters and their ascii values in Latin1:
Ä 196 Å 197 Æ 198 Ö 214 Ø 216
When one does an 'order by' the sorting bases on the ascii values, but there are exceptions (like Å,Ä,Ö) and with non-binary fields lower case is same as upper case.
In Finnish the order for Å,Ä,Ö is Å,Ä,Ö. How do they arrange in your language? I thought that 'Æ' is similar to 'Ä' and 'Ø' is similar to 'Ö'. Then the order would be Å,Ä,Æ,Ö,Ø and this is how MySQL does it now, with latin1. But you said the order should be 'Æ','Ø','Å'. Are you sure about this? What are positions for 'Ä' and 'Ö' there? What is your language (is it Norwegian?) In other character sets than latin1 the order may be different and there may be some other characters. I'm sorry, but I don't know what character set you should be using, but a rough guess would be latin2.
Character sets are not a 'MySQL' standard, but used worldwide. For different countries there are different character sets and this applies to all software. What character set should you be using? If it is other than latin1, alas you can't change it for 3.22 (because it needs to be compiled. We could make another release of 3.22 for Win with another character set compiled in, but this would likely be made for official 3.22 version).
With 3.23 you can change character set dynamically, at the MySQL server start up. (option to mysqld)
If you are using right character set and it doesn't sort characters correctly, it is a bug in sorting and we will fix it.
Regards,
- Jani
Hi Jani,
Yes, my language is Norwegian, and we too use the ISO 8859-1 Latin 1 character set. The sorting order in Norway is as follows:
Æ,Ø,Å
I'm 100% certain about it, and almost 99.9% sure that this is the case in Denmark as well.
Yes.. you can be 100% sure about it now ;) I checked this and the order in Danish and Norwegian is Ä,Ö,Å and in Finnish and Swedish it is Å,Ä,Ö.
Funny though...
Then there must be at least two different ways ordering these characters alphabetically.
In MySQL the character set determines what characters are allowed in names and how things are sorted by the ORDER BY and GROUP BY clauses of the SELECT statement.
Which was pretty much as expected. And by the way, the ascii values =
Using Ä and Ö is not too common in Norway anymore, although they are still exist - mostly in hand writing. You are right about these being similar to Æ(=Ä) and Ø(=Ö). As I wasn't 100% sure about the order, I put up an Excel worksheet with these characters, sorted the column and got the following result:
Æ,Ä,Ø,Ö,Å
Which was pretty much as expected. And by the way, the ascii values are the same as you stated above.
I seems to me that ISO8859-1/Latin 1 does not specify a sorting order, only a character set.
Ok. My original idea was that maybe in Norway and Denmark there would have been another character set in use (like latin2) or something like that, but if ISO8859-1/Latin 1 (which is the default character set in MySQL) is the right one for you too, then I don't know..
I was thinking that in another character set there would have exists all the same characters as in Latin1, but in different order.
I will try to find out about this and report you and the mailing list back.
It there any hope for me...? I'm really beginning to like MySQL, and I would prefer to run it on a Windows platform. ;)
Of course. If there isn't yet, we'll come up with a solution ;)
-Bjarte-
Regards,
- Jani
+---------------------------------------------------------------+ | TcX ____ __ _____ _____ ___ | | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Jani Tolonen | | /*/ /*/ /*/ \*\_ |*| |*||*| mailto:ja...@mysql.com| | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Helsinki | | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ Finland | | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^ | | /*/ \*\ Developers Team | +---------------------------------------------------------------+




