Subject Chinese/Korean (was Re: Non - printable characters in Stored Procedures)
Author peter_jacobi.rm
Hi David,

--- In firebird-support@yahoogroups.com, dhay@l... wrote:
> > so I can only hope, that GB_2312 in its binary sort order
> > is of some use.
> Dare I ask what if it's not?!! How easy would it be to create/add a
> collation? We have some Chinese colleagues here...

You can't add a new collation by data tables only (you
could vote on this request for enhancement, if we
had voting in sourceforge bug tracker...).

So you can add new collation by either expanding the
fbintl.dll or adding a fbintl2.dll.
There is sample fbintl2.dll source code at
http://groups.yahoo.com/group/Firebird-Architect/files/charsets_and_collations/

Also be invited to have a look in the source tree:
http://cvs.sourceforge.net/viewcvs.py/firebird/

The relevant stuff is in firebird2/src/intl
looking into the source for Korean:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/firebird/firebird2/src/intl/lc_ksc.cpp?content-type=text%2Fplain&rev=1.7

You see the function LCKSC_string_to_key. This is where the
important stuff happens. The string is converted by language
dependent rules into a byte string, which can be compared
using normal binary comparison.

> > I've got at least one other support question for
> > GB_2312, and after clarifyinmg some basics, no further
> > complaints.
> Can I ask what?

Essentially, that Firebird doesn't do any install locale
depending automatic setup and the character sets must
be specified 'manually'. Which leads to your next
question:

> Do you have any advice on setting up a single application
> that will be used in multiple countries ie best way to
> change char sets depending on install
> locale?

Join the efforts to make Firebird 2.0 I18n more
userfriendly?

Seriously, you need a large table mapping charsets and
locales to the best matching Firebird charset and collation.
The best match found is used for table creation and as
connection charset.

Regards,
Peter Jacobi