Wine not importing japanese characters in UTF-8 .reg files correctly

Questions about Wine on Linux
Locked
bynw
Level 1
Level 1
Posts: 5
Joined: Sun Apr 04, 2021 11:21 pm

Wine not importing japanese characters in UTF-8 .reg files correctly

Post by bynw »

Hi.
Regedit doesen't import japanese characters correctly from a UTF-8 .reg file. e.g

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\サッカ]
"InstMode"= hex:02,00,00,00
"InstPath"="C:\\games\\Soccer"
The サッカ is imported as gibberish.
Any help would be appreciated. Thanks.
bynw
Level 1
Level 1
Posts: 5
Joined: Sun Apr 04, 2021 11:21 pm

Re: Wine not importing japanese characters in UTF-8 .reg files correctly

Post by bynw »

Converting the file to utf-16le and adding BOM fixed this issue for me.
Following is the code that worked (stolen)

Code: Select all

file='bat.reg'
printf '\xFF\xFE' > $file.utf16le
iconv -f UTF-8 -t UTF-16LE $file >> $file.utf16le
mv -v $file.utf16le "converted-$file"
Locked