Page 1 of 1

Translate a non UTF Database into UTF8

Posted: Mon 21 Sep 2009 08:39
by pwatel
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

Posted: Tue 22 Sep 2009 08:25
by Plash
You can try to use the TCRBatchMove component to copy data.

The mover does not move

Posted: Tue 22 Sep 2009 09:54
by pwatel
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

Posted: Fri 25 Sep 2009 08:08
by Plash
Try to set the UseUnicode option to True for the connection connected to the UTF-8 database.

I had done it..

Posted: Mon 28 Sep 2009 10:11
by pwatel
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

Posted: Mon 28 Sep 2009 10:28
by Plash
Yes, please send us your demo.