Translate a non UTF Database into UTF8

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
pwatel
Posts: 39
Joined: Wed 11 Feb 2009 09:42

Translate a non UTF Database into UTF8

Post by pwatel » Mon 21 Sep 2009 08:39

Hi everyone,
Having switched from D6 to D2009 so now all string are unicode, I have a legacy Firebird DB in char set none given I have nearly completed the code changes and I would like to upgrade the database in full UTF8 for all string fields (we use a combination of Greek, French and English names.....)
I know how to rewrite the entire database with empty data in SQL
but what about data transfer

1) Do I have to write code with 2 connections and translate each records
via
DatasetUTF.insert
DatasetUTF[field1].asstring := Dataset[field1].asstring ;
DatasetUTF.post

2) or via
SQL insert
parameter('pname').aswidestring = Dataset[field1].asstring

3) Or any other methods backup/ restore

4) Or other unknown simpler methods ?????

I am sure others have been faced with the same issue.....
Thanks
Philippe Watel

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 22 Sep 2009 08:25

You can try to use the TCRBatchMove component to copy data.

pwatel
Posts: 39
Joined: Wed 11 Feb 2009 09:42

The mover does not move

Post by pwatel » Tue 22 Sep 2009 09:54

Thanks for your solution but the
TCBatchmove gives me an error
"Cannot transliterate character between characters sets"

Which is what I want to go from NONE to UTF8
Any ideas
Regards
PW

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 25 Sep 2009 08:08

Try to set the UseUnicode option to True for the connection connected to the UTF-8 database.

pwatel
Posts: 39
Joined: Wed 11 Feb 2009 09:42

I had done it..

Post by pwatel » Mon 28 Sep 2009 10:11

From the start I had done it
I tried with mentioning explicitly
the char sets
NONE/UTF8
or just unicode flag on the source/destination OFF/ON
I get the same message that
Cannot transliterate between char sets...
I can send you my usual demo if you want
Regards
Pw

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 28 Sep 2009 10:28

Yes, please send us your demo.

Post Reply