Archive: 8th Wonder of the World: Come the see the Unconvertable file


8th Wonder of the World: Come the see the Unconvertable file
Hello


I am attempting to use the Unicode Plugin to convert a UTF-16-LE file to ANSI but its just not working.

When I run the function unicode::FileUnicode2Ansi, the output file is empty, when it should contain the UTF-16-LE text contents(converted to ANSI).

Do you know how I can fix this?

Relevant Information:
- I am using NSIS ANSI version
- I am using the Unicode_V1.1.zip version of the Unicode Plugin
- The Unicode Plugin can sucessfully convert other UTF-16-LE files ok but just not my one for some reason.

My file is attached and I would appreciate if anyone could provide any insight into why this wont convert properly and how I can convert it without loosing all my file text/contents.

Section "Dummy" 

System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r9)"
MessageBox MB_OK "Current directory: $9"

#Convert file from Unicode to ANSI
StrCpy $0 "env_configs.xml"
StrCpy $1 "abcenv_configs.xml"
StrCpy $2 AUTO

unicode::FileUnicode2Ansi "$0" "$1" $2
Pop $3

MessageBox MB_OK "Res of conversion $3"
SectionEnd

The plugin calls WideCharToMultiByte with the WC_DEFAULTCHAR flag, I don't think you can pass that flag as the only flag.

For v1.1 grab a hex editor and find FF 75 E8 FF 75 F0 6A 40, change 40 to 00


Ufff this is a real question? I supposed it is some kind of spam because the title was so strange :)