Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004635 [JEDI VCL] 00 JVCL Components minor sometimes 2008-12-22 08:40 2009-07-08 14:10
Reporter wesson View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0004635: Under non unicode versions of Delphi AppStorage classes may fail to properly save / reload unicode strings
Description This apply to D2007 and below, and under a Japanese version of Windows.

Some stored wide (unicode) strings might be garbaged by the JvRegistryAppStorage component.

Internally, unicode string are converted into UTF-8 strings. however, when these strings are stored to and loaded from the registry, they are considered as ANSI strings - so windows may apply some sort of conversion with the current user default code page.

Problem is that, for japanese users (and maybe other like chinese ...), the codepage-based conversion may misinterpret UTF-8 formatted string, such as when the string is reloaded from the registry, it might have been changed by windows.

This may corrupt stored pathes containing unicode characters. For instance we store a path to user's documents, and user name has some japanese characters.
Additional Information Solution might be to implement virtual methods

DoReadWideString
and
DoWriteWideString

in base class (on the model of DoReadString and DoWriteString),

and override them in JvRegistryAppStorage class with direct access to widestring registry storage (to avoid the use of UTF-8 formatted strings in registry)

Tags No tags attached.
Attached Files ? file icon jvRegistryStorage_safe_widestring.patch [^] (4,726 bytes) 2009-06-29 10:35

- Relationships
related to 0004586resolvedobones JvAppStorage: No longer load/save char property 

-  Notes
(0015171)
wesson (reporter)
2008-12-22 08:44

Issue added as requested by Obones in notes of issue 4586

"
As to the ReadWideString/WriteWriteString functions, please create a new issue with more details for them

"
(0015177)
obones (administrator)
2008-12-23 00:42

Could you provide diff for both the base class and the registry storage class?
(0015440)
obones (administrator)
2009-04-29 11:19

Hello, any news?
(0015482)
wesson (reporter)
2009-04-29 15:36

sorry for the delay, I forgot this. I'll add this asap
(0015728)
jfudickar (developer)
2009-06-28 16:53

Any News?
(0015732)
wesson (reporter)
2009-06-29 10:41

Finally it is here, attached patch build on revision 12353

The base AppStorage class receive 2 additionnal virtual methods to handle widestrings,

The registry AppStorage class override these methods to explicitly call RegReadWideString/RegWriteWideString for WideString storage, instead of converting WideString to UTF8 string and load/store them using RegReadString/RegWriteString

Please note that starting from Delphi 2009 , this is no longer required
(0015780)
obones (administrator)
2009-07-08 14:10

This is now in SVN.

- Issue History
Date Modified Username Field Change
2008-12-22 08:40 wesson New Issue
2008-12-22 08:44 wesson Note Added: 0015171
2008-12-23 00:41 obones Relationship added related to 0004586
2008-12-23 00:42 obones Note Added: 0015177
2008-12-23 00:42 obones Status new => feedback
2009-04-29 11:19 obones Note Added: 0015440
2009-04-29 15:36 wesson Note Added: 0015482
2009-06-28 16:53 jfudickar Note Added: 0015728
2009-06-29 10:35 wesson File Added: jvRegistryStorage_safe_widestring.patch
2009-06-29 10:41 wesson Note Added: 0015732
2009-07-03 17:30 obones Status feedback => acknowledged
2009-07-08 14:10 obones Note Added: 0015780
2009-07-08 14:10 obones Status acknowledged => resolved
2009-07-08 14:10 obones Fixed in Version => Daily / SVN
2009-07-08 14:10 obones Resolution open => fixed
2009-07-08 14:10 obones Assigned To => obones


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker