TRegistry: regression when reading a key that has unicode charcters in it's name
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
If you try to read a key, that has unicode characters in it's name the result will be an empty string.
Steps to reproduce:
Open regedit.
In HKCU\Software create the key 'XXXXXXXXXX' (10 X's)
In HKCU\Sotware\XXXXXXXXXX create the string with name 'äëï' and set content to anything other than an empty string.
Build and runn attached program.
Note: the sourcode is encoded in cp1252.
Output with fpc 3.0.4 and Delphi 7:
Value="a-umlaut,e-umlaut,i-umlaut"
Output with fpctrunk:
Value=""
Additional information:
In current registry implementation, before querying the API the AnsiString parameters are converted to UnicodeString using Utf8Decode().
In the attached example project Utf8Decode(Name) will give you (represented as word values): 003F 003F 003F, while the proper representation of Name as UnicodeString is 00E4 00EB 00EF.