regedit: Allow importing UCS-2 and UTF-8 files created by Windows' regedit v5

Robert Shearman rob at codeweavers.com
Thu Oct 12 09:51:44 CDT 2006


Paul Chitescu wrote:
> Changelog: regedit: Allow importing UCS-2 and UTF-8 files created by Windows' 
> regedit v5.
>
> The code tries to detect the encoding from the first read bytes. UTF-8 is not 
> modified while UCS-2 is converted by keeping only the lower byte.
>   

The code that you have added is really nasty. At the very least, you 
should be using WideCharToMultiByte to convert the UCS-2 characters, 
instead of just truncating them. Ideally though, the code should be 
converted to call the Unicode versions of the registry APIs and then to 
use MultiByteToWideChar to process UTF-8 and ASCII (CP_UNIXCP?) files.

-- 
Rob Shearman




More information about the wine-devel mailing list