Subject Re: [firebird-support] Re: Converting of an ISO8859_1 database to UTF8
Author Martijn Tonies
Hello Patrick,

>> > 3.3 Doing everything manually
>> > Means probably the most work, but appears to be the safest way at the
>> > moment.
>> > 3.3.1 I could start with the final UTF8 database, i.e. with all the
>> > structure changes etc. included
>> > 3.3.2 The source database would be accessed by a connection with
>> > ISO8859_1
>> > as character set, the UTF8 one by a connection with UTF8 as character
>> > set
>>
>> This would work if the application is able to read ISO8859_1 and write
>> UTF8,
>
> What do you mean by this? My new application is written in Delphi XE,
> which supports unicode. Wouldn't reading work with an connection, which
> has ISO8859_1 as character set? Maybe I could even access the fields as
> AnsiString if needed. The writing would happen over the UTF8 connection.
>

AsAnsiString makes sure you get an AnsiString, but if you want to convert to
UTF8
anyway, you can use AsString.

>> Use USO8859_1, no Unicode client, for the source, and UTF8, Unicode
>> client
>> for the destination.
>
> Hm, same as above... I hoped to do it with one client (if it shall be the
> point "3.3 Doing everything manually" from my first post).. How else can I
> get the data from the ISO8859_1 client to the UTF8 one?
>

Well, you can use the same technique in one a custom build application to
transfer the data.

>> > Regarding 3.1.4 and 3.2.4: I've found this example on how to change the
>> > blob type:
>> > UPDATE RDB$FIELDS SET RDB$FIELD_SUB_TYPE = 0
>> > WHERE RDB$FIELD_NAME=(SELECT RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS
>> > WHERE RDB$FIELD_NAME='SOME_TEXT_BLOB_FIELD' AND
>> > RDB$RELATION_NAME='SOME_TABLE');
>> > Seems to work without the content getting lost. Sure, it's in the wrong
>> > format that way, but it seems to be possible to obtaint the content and
>> > then to save it in the new format. But depending on the choice of the
>> > way
>> > to go, this could be irrelevant.
>>
>> You are modifying the blob to BINARY, that doesn't sound right.
>>
>
> Yes, didn't look that "healthy" to me too, but has worked and that's what
> IBExpert (I believe) has made of my attempt to change the sub type
> manually.
>

Hopefully not of a text column you still want to use as text?

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!