Subject Re: [firebird-support] Re: Using unicode versus WIN1252 (Firebird 2)
Author Milan Babuskov
josef_gschwendtner wrote:
>> Main issue is the storage size of Unicode and UTF8. Since more
> bytes are
>> used per character, this means that you can have less characters in
>> char/varchar fields, procedure parameter, indexes and for
>> sorting/grouping operations. Consequently, some of your queries
> that
>> work with WIN1252 might fail with UTF8.
>
> German characters mostly have ASCII < 7F. With UTF8 these characters
> have the same storage size as in WIN1252, right?

Only when represented in UTF8 form. However, Firebird internally
represents them as 4-bytes-per-character internally.

> Isn't it correct that a field/parameter with varchar(50) always has
> room for 50 characters (albeit some characters need more then one
> byte)?

Yes, of course. But Firebird has various limits that are defined in
bytes. Try creating a CHAR(32000) column with UTF8 and WIN1252 charset
to see what I'm talking about.

>> Creating a new database and copying the data is as easy as:
>>
>> gbak -b -m database.fdb database.fbk
>> gbak -c database.fbk new_database.fdb
>> fbcopy se database.fdb new_database.fdb
>
> With this methode the new database has the same character set as the
> old one, right?

You're right, sorry about that.

> What would be best practice to get a new database with a different
> default character set (UTF8)?

Dump the DDL (using isql -x or your favorite admin. tool), find&replace
with some text editor, create a new database with UTF8 default charset
and run DDL script in it.

--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com