Thread: NSIS 3.0a1
View Single Post
Old 7th October 2013, 11:37   #28
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 882
So the idea looks similar to this:

Quote:
handle = openfile(filename.txt);
if (isUnicodeInstaller()) // returns true or false
{
if (isUnicodeFile(handle)) // if both the same, do nothing
{
}
else // ansi file, convert to unicode
{
convertToUnicode(handle);
}
else // ansi installer
{
if (isUnicodeFile(handle)) // if unicode file, convert to ansi
{
convertToAnsi(handle);
}
else // both the same, do nothing
{
}
}
I have had a quick look at the code for the license loading, but I don't understand alot of it because I'm not familiar with the c++ side, though it looks like the LoadLicenseFile function (in script.cpp) is converting the text to wchar_t regardless of the file encoding.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote