Subject | SV: [IBO] Migrating to Firebird - how about Unicode? |
---|---|
Author | Jacob Havkrog |
Post date | 2011-07-20T13:28:54Z |
Hi Jason
You recommend that I create my databases with UTF8 default character set in order to be Unicode-ready.
I have some difficulties doing that...
I've got at datapump application that creates a Firebird database from a BDE database and pumps the data. That application is built using the Delphi 2007 components TIBDatabase, TIBTransaction, TIBQuery and TIBTable. That bit seems to be working fine.
But when I try to use TIB_Connection, TIB_Transaction, TIB_Script and TIB_DSQL, using the same script as generated by the first datapump application to build the database, I get "malformed string" exceptions when pumping text that contain special national characters like ÆØÅ.
If I choose ISO8859_1 as charset then I don't get those exceptions. Can you tell me whats going on?
I'm a bit confused about the possibility of using IBDatabase to build a Firebird database. (I didn't write that code myself.) I wouldn't except an InterBase component to work on a Firebird 2.5 database building a ODS11.2 database...
I'm been trying to separate the creating of the Firebird database from the data pumping, but regardless of whether I'm using TIB_Table or TIBTable, I get the "malformed string" error. That doesn't happen if the database is created and pumped in one go. I'm pretty mystified...
A side question - just to be sure:
I use Delphi 2007 and need to complete the conversion of my app from BDE/Paradox to IBO/Firebird before migrating to Delphi XE+ and Unicode. Do I need to change anything in my current code in order to use UTF8 as the default database charset? Like changing TStringField to TWideStringField? I really hope not... I just want to stay with one-byte character strings until I make the jump to XE.
Thanks for any pointer or help..
Jacob
Fra: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] På vegne af Support List
Sendt: 13. juli 2011 21:25
Til: IBObjects@yahoogroups.com
Emne: RE: [IBO] Migrating to Firebird - how about Unicode?
Jacob,
moving over to better underlying technology then just go for the whole jump
and focus on using scripted mechanisms so that you can migrate things in an
automated way, do a bunch of testing, etc. When you find problems, modify
your scripts to convert things over and then keep at it until it is
perfected.
ASCII if you are only using ASCII characters anyway. This shouldn't be that
big of a deal so I recommend going with a UTF8 based database so that you
are ready for Unicode data when the time comes.
migrate your application over to IBO TDataset based components by following
the BDE to IBO Conversion guide on my website www.ibobjects.com.
default character set instead of ASCII.
Keep us posted on your progress.
Also, if you would like to have more direct support I do have availability
for small or short-term contracts to assist with projects like this. I could
probably do your conversion very quickly. I also provide services of doing
complete code and architecture reviews of IBO based applications to look for
potential problems, performance drains, etc.
Regards,
Jason LeRoy Wharton
www.ibobjects.com
[Non-text portions of this message have been removed]
You recommend that I create my databases with UTF8 default character set in order to be Unicode-ready.
I have some difficulties doing that...
I've got at datapump application that creates a Firebird database from a BDE database and pumps the data. That application is built using the Delphi 2007 components TIBDatabase, TIBTransaction, TIBQuery and TIBTable. That bit seems to be working fine.
But when I try to use TIB_Connection, TIB_Transaction, TIB_Script and TIB_DSQL, using the same script as generated by the first datapump application to build the database, I get "malformed string" exceptions when pumping text that contain special national characters like ÆØÅ.
If I choose ISO8859_1 as charset then I don't get those exceptions. Can you tell me whats going on?
I'm a bit confused about the possibility of using IBDatabase to build a Firebird database. (I didn't write that code myself.) I wouldn't except an InterBase component to work on a Firebird 2.5 database building a ODS11.2 database...
I'm been trying to separate the creating of the Firebird database from the data pumping, but regardless of whether I'm using TIB_Table or TIBTable, I get the "malformed string" error. That doesn't happen if the database is created and pumped in one go. I'm pretty mystified...
A side question - just to be sure:
I use Delphi 2007 and need to complete the conversion of my app from BDE/Paradox to IBO/Firebird before migrating to Delphi XE+ and Unicode. Do I need to change anything in my current code in order to use UTF8 as the default database charset? Like changing TStringField to TWideStringField? I really hope not... I just want to stay with one-byte character strings until I make the jump to XE.
Thanks for any pointer or help..
Jacob
Fra: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] På vegne af Support List
Sendt: 13. juli 2011 21:25
Til: IBObjects@yahoogroups.com
Emne: RE: [IBO] Migrating to Firebird - how about Unicode?
Jacob,
> Hi - I'm migrating a Delphi 2007 application from Paradox/BDE toExcellent!
> Firebird/IBO.
> My thinking is that it's better to migrate away from Paradox to FirebirdIf you intend for your application to remain unchanged with the exception of
> >before< migrating to Delphi XE and Unicode.
moving over to better underlying technology then just go for the whole jump
and focus on using scripted mechanisms so that you can migrate things in an
automated way, do a bunch of testing, etc. When you find problems, modify
your scripts to convert things over and then keep at it until it is
perfected.
> My applications don't need special character processing, so I don't needWell, you really shouldn't have too much trouble by using UTF8 instead of
> the Unicode as such.
ASCII if you are only using ASCII characters anyway. This shouldn't be that
big of a deal so I recommend going with a UTF8 based database so that you
are ready for Unicode data when the time comes.
> I assume that I would have a lot of problems getting the Paradox/BDE toI would get your data migrated over into a Firebird SQL database and then
> function in Delphi XE with all the necessary conversions of
> character/string handling code. If I would choose to go to Delphi XE
> before migrating databases.
>
> Any comments?
migrate your application over to IBO TDataset based components by following
the BDE to IBO Conversion guide on my website www.ibobjects.com.
> Right now I'm preparing the scripts for creating the Firebird database. IsWell, you could just go ahead and create your database with UTF8 as the
> there anything I should think about now in relation to future unicode
> string handling?
default character set instead of ASCII.
> E.g. when I create a field likeYes, if your database default character set is UTF8.
>
> FIRSTNAME CHAR(15)
>
> Will I be able to store a 15 character Unicode string here after I have
> compiled my application with Delphi XE?
> Any other considerations/preparations I could do now?Nothing comes to mind.
Keep us posted on your progress.
Also, if you would like to have more direct support I do have availability
for small or short-term contracts to assist with projects like this. I could
probably do your conversion very quickly. I also provide services of doing
complete code and architecture reviews of IBO based applications to look for
potential problems, performance drains, etc.
Regards,
Jason LeRoy Wharton
www.ibobjects.com
[Non-text portions of this message have been removed]