views:

218

answers:

3

I'm looking for the best option to store my application settings. I decided to write own class that inherits from TPersistent which would store all the config options available. Currently I'm looking for the best way to save it - and I found JvAppStorage which looked very promising (as I'm using JVCL in my project anyway...) but it doesn't handle unicode (WideStrings) properly. For XML files it stores chars as entities, for ini file it seems to be stored ok, but in both cases loading strings replaces the text with lots of question marks...

Is there any good replacement that handles Unicode as well?

Thanks in advance.

+2  A: 

Recently converted to JSON from ini files (and dreaded xml!) for setting storage. It's just so convenient and flexible. See SuperObject.

utku_karatas
SuperObject does handle unicode well.
skamradt
That is not really what I looked for. I'm looking for something to load/save the object, using RTTI.
migajek
+1  A: 

It's quite common use use UTF-8 as the on-disk representation of Unicode data. In your code, use the Utf8String data type to hold data encoded that way so you remember that you'll need to convert it before using it in the rest of your application.

Rob Kennedy
A: 

I use MSXML to store settings per user in a personal directory on the network. It should handle Unicode as well.

Roland Bengtsson
migajek