View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005313 | JEDI VCL | 00 JVCL Components | public | 2010-08-30 05:08 | 2010-10-10 18:15 |
Reporter | Kiriakos | Assigned To | jfudickar | ||
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
Summary | 0005313: JvAppStorage does not work with WideStrings and Delphi 2010 | ||||
Description | The idea of the recent updates to jvAppIniStorage is to use the Encoding of the IniFile to save unicode strings. The code for writing/reading WideStrings does not work currently and it needs to be aligned to the standard way of saving unicode strings. I suggest the following changes to JvAppStorage procedure TJvCustomAppStorage.DoWriteWideString(const Path: string; const Value: Widestring); begin {$IFDEF COMPILER12_UP} DoWriteString(Path,string(Value)); {$ELSE} DoWriteString(Path,string(UTF8Encode(Value))); {$ENDIF COMPILER12_UP} end; function TJvCustomAppStorage.DoReadWideString(const Path: string; const Default: Widestring): Widestring; begin {$IFDEF COMPILER12_UP} Result := ReadString(Path, string(Default)); {$ELSE} Result := UTF8Decode(ReadString(Path, UTF8Encode(Default))); {$ENDIF COMPILER12_UP} end; The idea is that if say you want to save a Persistent object with both normal string properties, which are now Unicodestrings, and WideString properties you would have to set the IniFile encoding to UTF8, which will now take care of WideStrings. The above changes take care of WideString properties and WideStringLists and no further changes should be required. | ||||
Tags | No tags attached. | ||||
|
But what about a AppStorage engine which supports WideStrings (maybe a database engine). With your code all widestrings are stored encoded, isn't it? Regards Jens |
|
The code I suggests treats in Unicode versions of Delphi WideStrings in the same way it treats strings (aka UnicodeStrings). Remember that both WideStrings and standard strings are Unicode. If something works for standard strings it should be good enough for WideStrings. If it doesn't it needs fixing for standard strings as well. |
|
So what do we do here? |
|
Added to svn |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-08-30 05:08 | Kiriakos | New Issue | |
2010-09-06 00:34 | jfudickar | Note Added: 0017650 | |
2010-09-06 00:34 | jfudickar | Status | new => feedback |
2010-09-06 17:22 | Kiriakos | Note Added: 0017658 | |
2010-10-08 16:31 | obones | Note Added: 0017831 | |
2010-10-10 18:15 | jfudickar | Note Added: 0017853 | |
2010-10-10 18:15 | jfudickar | Status | feedback => resolved |
2010-10-10 18:15 | jfudickar | Resolution | open => fixed |
2010-10-10 18:15 | jfudickar | Assigned To | => jfudickar |