UTF8 Charset


I am using eastern european charset and trying to display some data from the database.  Data are already correctly stored in the database and I see letters as it should be (for example žući).
However, when I display those data in TDBEdit component I see it like (žuci). Second letter is not displayed correctly. I was trying to go in debug mode and retrieved data like this:

Place := AureliusDatasetMain.Current<TPlace>;

First ShowMessage shows correctly žući while second ShowMessage shows žuci.  From this I draw conclusion that it is something in AureliusDataset component and have no idea what.
And yes I did set AureliusDatasetMain->FieldDefs->Name to ftWideString and also put mainGrid.Columns[0].ShowUnicode := true in which case I got following character in every row '|'. I was wondering if you have any idea what could be cause of this?


That's by default. Any string property is mapped to "Ansi" (varchar) in database. I believe your database was not created by Aurelius, but instead was already created with types "NVarchar" instead of "Varchar"?

IF that's the case, all you have to do is change a global configuration:

uses Aurelius.Global.Config;

TGlobalConfigs.GetInstance.MapStringToNationalChar := true;

No, my database is created by aurelius.  I used DataModeler to create tables and for that field I set it

Logic Type: Varchar
Physical Type: VARCHAR(64)

I use also DatabaseManager.BuildDatabase for creating it and also DatabaseManager.DestroyDatabase for deleting it.
I have also created text file where I keep those data and use Aurelius to fill up the database.  Now when I do as you suggested, program throws this error message:
arithmetic exception, numberic overflow, or string truncation. Cannot transliterate character between character sets.

If I remove 
TGlobalConfigs.GetInstance.MapStringToNationalChar := true;
then database loads just fine and data seems to be ok (works correct when I use Aurelius and fill up TAdvStringGrid).  Maybe I can create shorter version of program and send it to you?

OK. I have created example.  How I can send it?


See http://www.tmssoftware.com/site/support_mail.asp for information on how to contact us by email.

Just update on this one in case someone else need solution.  Thanks to Wagner R. Landgraf for helping me on this one.

Trick is in following. When you select Aurelius dataset (I suppose that is true for any other dataset as well) first go to object inspector and select FieldDefs and then change string field which you want it to be unicode into ftWideString and after that right click on dataset->FieldsEditor and add fields. What I did wrong is that I have retrieved fields, then added them into "fields editor" and then changed it to ftWideString in object inspector and that of course did not change field type I have already added.

Hope this helps,