Closed GoogleCodeExporter closed 9 years ago
I think I have the same defect here. I use MUI_INSTALLOPTIONS_WRITE (which it
turn uses WriteIniStr) to write a language string. When the language is English
or German, then everything is fine. But when I use Japanese, then I see ????
instead of Japanese hieroglyphs. As I can see, WriteIniStr uses single-byte
character ini files and, probably, cannot handle languages with codepage, other
than win-1252.
Original comment by aleks....@gmail.com
on 8 Apr 2011 at 10:15
More investigation: as I can see from the NSIS sources, WriteIniStr uses
WritePrivateProfileString WinAPI function:
http://msdn.microsoft.com/en-us/library/ms725501%28VS.85%29.aspx. As
documentation says, "If the file was created using Unicode characters, the
function writes Unicode characters to the file. Otherwise, the function writes
ANSI characters". So, probably, before writing first time with
WritePrivateProfileString, NSIS will need to create the file (by other means)
with Unicode BOM.
Original comment by aleks....@gmail.com
on 8 Apr 2011 at 10:39
So, I solved the problem by replacing (in the Unicode NSIS source code) every
call of the Windows API WritePrivateProfileString to a call of a custom
WriteIniString function. The replacement is to be done in exec.c and
InstallerOptions.cpp files. The WriteIniString function's declaration and
definition is in the attached files.
What WriteIniString basically does in Unicode version is first (before actually
calling WritePrivateProfileString) checks if the ini-file already exists, and
if not - creates it and writes UTF-16 BOM to the file. ANSI version just calls
WritePrivateProfileString.
Original comment by aleks....@gmail.com
on 8 Apr 2011 at 9:02
Attachments:
Hi,
thanks,
I will try that next week, I hope I could use this files in windows version,
else I will try by converting files script to unicode with notepad++..
good week end :)
bye
Original comment by cbabyf...@gmail.com
on 8 Apr 2011 at 9:35
Hi,
the problem is that the files I modified is not created by nsis, I just modify
it, and this is a file of configuration .cfg created by a python script.
And I can't use you modified NSIS files because I'm with windows to build
installer ...
So, no available solution for me :(
bye
Original comment by cbabyf...@gmail.com
on 13 Apr 2011 at 1:53
Can you modify your Python script to create those cfg files in UTF-16 encoding?
This will make WriteIniStr to work correctly.
Original comment by aleks....@gmail.com
on 15 Apr 2011 at 9:44
Hi,
thanks again for your support,
I don't think it is possible for me actually. I will hope to have a new version
installer for windows with this correction include.
Thanks again ;)
Bye
Original comment by cbabyf...@gmail.com
on 18 Apr 2011 at 6:51
[deleted comment]
Unfortunately, it is working as intended. The Unicode NSIS works on UTF-16
files, not UTF-8. So unless you can create an INI file with UTF-16 encoding,
NSIS won't work. But having said that, you can use a2u.exe that is downloadable
from this site to convert the INI file from UTF-8 to UTF-16 before you start
processing it. Is that acceptable?
Original comment by jim%scra...@gtempaccount.com
on 17 Jun 2011 at 6:08
Since this is the behavior as intended. I'm closing this issue as WontFix.
Original comment by jim%scra...@gtempaccount.com
on 6 Jul 2011 at 3:31
Original issue reported on code.google.com by
cbabyf...@gmail.com
on 23 Mar 2011 at 2:11Attachments: