jimpark / unsis

Automatically exported from code.google.com/p/unsis
Other
59 stars 15 forks source link

variable exported ????? with russian cyrillic characters #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
What steps will reproduce the problem?
I enter in a page values to be used in a file.conf using WriteIniStr, and in a 
command line to install postgresql 8.4 with options like --superaccount 
"$TextPostgreSQLUsername (works with french, english language)

What is the expected output? What do you see instead?
the output variable in my file.conf is ??????, and postgresql is not installed 
if I used only cyrillic characters.

What version of the product are you using? On what operating system?
last 2.46 unicode on vista system (french language, tested with keyboard 
russian)

Please provide any additional information below.
I attached my nsi script to see eventually the problem.
command line and WriteIniStr used to install postgresql and modify file.conf 
are lines 433 to 439

function showpostgresql and leavepostgresql are lines :
562 623

Thanks for reply :)
Bye

Original issue reported on code.google.com by cbabyf...@gmail.com on 23 Mar 2011 at 2:11

Attachments:

GoogleCodeExporter commented 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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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