Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 13th September 2012, 07:02   #1
gretty
Junior Member
 
Join Date: May 2012
Posts: 20
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.

code:
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

Attached Files
File Type: xml env_configs.xml (48.2 KB, 108 views)
gretty is offline   Reply With Quote
Old 18th September 2012, 14:23   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,320
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 19th September 2012, 09:27   #3
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 548
Send a message via ICQ to T.Slappy
Ufff this is a real question? I supposed it is some kind of spam because the title was so strange

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.4 Sydney: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump