![]() |
#1 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
Unicode conversion error 2.4x POSIX
Hi!
I'm trying to package an old project, which used to work but now suddenly doesn't. It seems to have something to do with MUI. Heres the error: code: I've been jumping from one error to the next for the past few days, but am now stuck with this. Does anyone have any clue how to solve this? |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
We need more information.
Are you changing the default MUI text? Windows version? NSIS version? Minimal example code? IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
This is the full nsis template script: https://pastebin.com/raw/YUYLvSWM
> Are you changing the default MUI text? Yes, it looks like some texts are being changed. > Windows version? NSIS version? This is where it gets tricky, im trying to cross-compile for windows on openSUSE. Using NSIS 2.46. I've also tried 3.03 and a whole other sea of errors occured. Im sure this was previosly working on 2.x. Is there anything else I can provide that could help? |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
winchar.cpp is the only place in 2.46 that can throw that error AFAIK. ResourceEditor.cpp will probably use it when changing the MUI dialog resource.
Did you compile all of NSIS on your linux machine? Try to copy the Contrib folder from a Windows install, your UI exe files might be broken somehow. You might also want to investigate if iconv on your system is working correctly because NSIS uses that on POSIX when converting to/from Unicode. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
> Try to copy the Contrib folder from a Windows install, your UI exe files might be broken somehow.
This seemed to work. Well, at least I got some new errors associated with some missing libraries. I fixed those errors and I'm now back to a similar error like before: code: |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
I tested iconv on the machine, it seems to be working (converted a iso-8859-1 file to utf8 successfully)
|
![]() |
![]() |
![]() |
#7 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
The version information needs to convert the VIAddVersionKey strings. Are those non-ASCII strings?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#8 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
They should be ASCII.
Just in case, I tried changing the strings to static values like this: code: and the same error still occurs. |
![]() |
![]() |
![]() |
#9 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Can you test it on Windows?
If not, try adding some "printf"s to MultiByteToWideChar in \Source\Util.cpp. I'm guessing iconv is failing somehow. What is your locale set to? IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
Can you test it on Windows?
I'm afraid setting that up would take very long, I'd rather avoid it if possible. If not, try adding some "printf"s to MultiByteToWideChar in \Source\Util.cpp. I'm guessing iconv is failing somehow. I'm getting compilation errors (previously nsis was installed from an rpm) and I'm not confident that I'm compiling it correctly. What is your locale set to? It was set to POSIX, tried setting en_US.UTF-8 and building again but that didn't help. |
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
Can you test it on Windows?
I'm afraid setting that up would take very long, I'd rather avoid it if possible. If not, try adding some "printf"s to MultiByteToWideChar in \Source\Util.cpp. I'm guessing iconv is failing somehow. I'm getting compilation errors (previously nsis was installed from an rpm) and I'm not confident that I'm compiling it correctly. What is your locale set to? It was previously set to POSIX, tried building with en_US.UTF-8 but that didn't help. |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
v2.46 is 10 years old so you might have more luck using a environment from that era. Did you try v3.x?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#13 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
3.03 also fails
code: |
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
That looks like a totally different issue. And it is a 3rd-party deprecated plug-in. Can we maybe focus on makensis itself first?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#15 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
After commenting out some (UAC related) lines, v3.03 built the installer successfully. The installer doesn't work correctly though (due to the UAC plugin).
I'm guessing that the unicode conversion code has changed since v2.46, or it is being skipped entirely as the strings are already ASCII? I think I'll have to replace the deprecated code and stick with v3.03 because the UAC plugin issue is clear but the v2.46 route would still need further debugging and at this point, I'm expecting another error to show up after that one is fixed. Or, maybe you know a better way? I'm not sure why the UAC plugin was used in the first place. I assume that the installers demand elevated privileges by default, otherwise how would they write to Program Files? ![]() |
![]() |
![]() |
![]() |
#16 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
2.x is not Unicode but some of the .exe resources needs Unicode strings. Unless you need to support Win95/98/ME you should move to 3.x. 2.46 used to work on POSIX but like I said, it is 10 years old and compilers and libraries have changed since then.
I would recommend that you dump the UAC plug-in but I can still take a look to see if there is an easy fix. On your end, you can just remove the Run checkbox from the Finish page if that is the only reason you are using it. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#17 |
Junior Member
Join Date: Jul 2019
Posts: 10
|
I've removed the UAC related code and everything seems to be working just fine.
It's truly inspiring to see a developer still care for an open source project for so long! TBH I didn't even expect to get any replies to this thread, let alone help from one of the main devs... Anyway, I've sent you a donation on paypal as an expression of my gratitude. It ain't much - but hey, lunch is on me ![]() Thank you for all your help! |
![]() |
![]() |
![]() |
#18 | |||||
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
A couple of things you can try for 2.x:
In util.cpp: * Change "CP%d" to "CP%d//TRANSLIT" in create_code_page_string. * in MultiByteToWideChar, change Quote:
Quote:
Quote:
Quote:
Make sure UAC.nsh contains Quote:
IntOp $PostCount $PostCount + 1 |
|||||
![]() |
![]() |
![]() |
|
Tags |
posix, unicode |
Thread Tools | Search this Thread |
Display Modes | |
|
|