View Issue Details

IDProjectCategoryView StatusLast Update
0005523JEDI VCL00 JVCL Componentspublic2011-07-10 14:34
ReporterZENsanAssigned Tojfudickar 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0005523: TJvAppINIFileStorage lose unicode
DescriptionTJvAppINIFileStorage lose unicode on saving String properties.
Sample application showing this is attached.
TagsNo tags attached.

Activities

2011-03-25 17:02

 

JEDI.zip (1,585 bytes)

jfudickar

2011-03-31 11:51

developer   ~0018492

Could you give some more explanations?

I'm using it with Delphi XE and the SVN Version of JCL and JVCL.

I can't see any problems.

Regards
Jens

2011-03-31 12:23

 

First run.png (16,696 bytes)
First run.png (16,696 bytes)

2011-03-31 12:23

 

Second run.png (16,626 bytes)
Second run.png (16,626 bytes)

ZENsan

2011-03-31 12:24

reporter   ~0018493

1) Run it once (AppStorage will save the property Text)
2) Run again (AppStorage lost 2 characters from Text property)

jfudickar

2011-03-31 21:33

developer   ~0018494

Ok, I'm not so fimilar with Unicode, but here is my explanation/workaround.

1. In the online help it's stated that the TIniFile is old stuff and that it allways was ansi, so the default is ansi.
2. Open your created ini-file in an unicode editor and change the codepage to utf-8 of the existing file. Restart your test application and from that moment unicode is working.
The inifile component detects that the original file is unicode and stores it in the detected codepage.

My Problem is, that I do not know how, what will be the best way to enhance the TAppIniStorage for a default codepage.

Regards
Jens

ZENsan

2011-04-01 09:32

reporter   ~0018499

Maybe before flushing first time (creating an INI file) we can create an empty UTF-8 text file (of course only for Unicode Delphi versions), and then call default INI file. And then everything wil work fine.

obones

2011-06-08 15:09

administrator   ~0018670

Except that I don't think the ini file handling class can detect UTF-8 from an empty file.
Can anyone test this?

ZENsan

2011-06-28 08:46

reporter   ~0018807

JvAppIniFileStorage1.IniFile.Encoding := TEncoding.Unicode;

Solves the problem. Maybe we can check the delphi version and if it supports unicode, then just set the default encoding to, say, TEncoding.UTF8?

jfudickar

2011-07-10 14:32

developer   ~0018819

The easier way is :
JvAppIniFileStorage1.Encoding := TEncoding.Unicode;

And the AppIniFileStorage has the default delphi behaviour (in point of ini encoding), so I do not see a need to change anything else.

Regards
Jens

jfudickar

2011-07-10 14:34

developer   ~0018820

No change needed

Issue History

Date Modified Username Field Change
2011-03-25 16:55 ZENsan New Issue
2011-03-25 17:02 ZENsan File Added: JEDI.zip
2011-03-31 11:51 jfudickar Note Added: 0018492
2011-03-31 11:51 jfudickar Status new => feedback
2011-03-31 12:23 ZENsan File Added: First run.png
2011-03-31 12:23 ZENsan File Added: Second run.png
2011-03-31 12:24 ZENsan Note Added: 0018493
2011-03-31 21:33 jfudickar Note Added: 0018494
2011-04-01 09:32 ZENsan Note Added: 0018499
2011-06-07 17:41 obones Status feedback => acknowledged
2011-06-08 15:09 obones Note Added: 0018670
2011-06-28 08:46 ZENsan Note Added: 0018807
2011-07-10 14:32 jfudickar Note Added: 0018819
2011-07-10 14:34 jfudickar Note Added: 0018820
2011-07-10 14:34 jfudickar Status acknowledged => resolved
2011-07-10 14:34 jfudickar Resolution open => fixed
2011-07-10 14:34 jfudickar Assigned To => jfudickar