[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MySQL Character Set



On Thu, 2003-03-27 at 08:28, Yaser Al-Jarbou wrote:
> Hi Walid 
> 
> I am using now MySQL-server-4.0.12-0.i386, and the character set is
> Latin1 by default. They claim that  4.1 which is beta version now has
> multiple character sets for many languages. 
> 
> I change the character set to hebrew, and it does sorting arabic
> letters very well. but I don't like this choice to be part of ancient
> jewish language.
> 
> I read the link of adding new character sets, but the difficulty here
> is how to write a new character sets. just give me a start. 

find here some searches I made quickly that might help I hope :

Quick Summery points :

1) use of BLOBS
2) read the Drivers README file
3) check you connect to the database
4) try putting that stanza in your configuration file 
	charset="utf-8"
5) Google :)

* FYI:  There is a parameter that can be set on the DB connection URL
that turns Unicode support on/off (useUnicode=true|false).  This appears
to work.  From the readme, the Unicode data is transcoded to the native
character set of the database before it is inserted. 

*the changelog for MySQL 4.1.0 (!!) lists UTF-8 support, and in the
meantime the approach to take would be to store your data in a BLOB
field.  MySQL treats BLOBs essentially identically to TEXT fields except
that it treats them as binary.  Therefore, what you put in should be
what you get out, period.

*The mm driver did a nice trick to convert the String characters (16 bit
unicode) into UTF that goes into the 8-bit characters of MySQL 3.xx
using the setting: useUnicode=true&characterEncoding=UTF-8

The mysql jdbc driver has changed this. To me it seems that the reason
is to be what above is said about MySQL 4.xx and to be more compatible
with MySQL in general. With this setting it would not have been possible
to use the database with other software than the mm jdbc driver.

The README on mysql driver says that using setting
useUnicode=false&characterEncoding=UTF-8
should do as it was with mm-driver. The data goes into MySQL 3.xx
database but reading it back does not give the right result. It seems
that mysql  driver does not function as mm-driver version x.x.x.14 did.

If you only use western european character sets then you shouldn't use these
settings at all. It is compatible with MySQL native character set. Only if you
need some other characters like Cyrillic, Arabic, Chinese or similar you are
in need of UTF-8 and perhaps using BLOB's is then a solution. Can you do
a query using BLOD-fields? I don't think so.

*anything you can do on a TEXT field you can do on a BLOB field.
There are some limitations with respect to indexing but queries against
BLOB columns should work just fine

* the above can be consolidated at the following post http://www.geocrawler.com/mail/msg.php3?msg_id=10212929&list=193


> 
> Regards
> -Yaser 
> 
>  Walid Shaari <Walid at melinux dot com> wrote: 
>         On Wed, 2003-03-26 at 08:54, Yaser Al-Jarbou wrote:
>         > Salam Alaikum
>         > 
>         > I have difficulty in sorting arabic letters during
>         retreiving data
>         > from MySQL server. Is there an arabic character-set works
>         MySQL or any
>         > solution to this problem.
>         I recall that one of the features that have been introduced in
>         4.x is
>         i18n, I have read that in linuxmagazine (the US edition).
>         
>         check this link for how to add a charset :
>         http://www.mysql.com/doc/en/Adding_character_set.html
>         unless you say more about what you have done, what is your
>         setup I am
>         afraid no one will be able to suggest a solution!
>         
>         Walid.
>         
>         
>         _______________________________________________
>         General mailing list
>         General at arabeyes dot org
>         http://lists.arabeyes.org/mailman/listinfo/general
> 
> 
> ______________________________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
-- 
Walid Shaari <Walid at melinux dot com>