Old 9th June 2022, 21:12   #1
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
install.log utf-16 Little Endian

Hi,

I am using the nsis logging build and my version is 3.08. For some reason when I open the install.log of my installer in notepad++, it says utf-16 Little Endian instead of utf-8. Any idea why this might be happening?
pkonduru is offline   Reply With Quote
Old 10th June 2022, 02:48   #2
papaimark
Junior Member
 
Join Date: Mar 2011
Posts: 13
Same thing with "TextWditorPro". Wikipedia explains what it is, and that's all.
papaimark is offline   Reply With Quote
Old 10th June 2022, 11:25   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,522
Utf 16 is the standard Unicode format on Windows, like it or not.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th June 2022, 16:49   #4
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
But is it supposed to be Little Endian?
pkonduru is offline   Reply With Quote
Old 10th June 2022, 17:26   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,522
Yes, Windows is always little endian.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th June 2022, 18:14   #6
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Thanks Anders for clearing that.
pkonduru is offline   Reply With Quote
Old 16th June 2022, 02:51   #7
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
Hi ANders,
Is there any way I can convert my install.log from utf-16 to utf-8?
pkonduru is offline   Reply With Quote
Old 16th June 2022, 11:10   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,522
https://nsis.sourceforge.io/Unicode_plug-in

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th June 2022, 16:45   #9
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
I did try this plugin but for some reason it keeps giving me the output 2 which is

"2" - wrong UnicodeType specified

StrCpy $0 "$INSTDIR\install.log"
StrCpy $1 "$INSTDIR\install.log"(I did try putting it to a different file too)
StrCpy $2 "AUTO"

unicode::FileUnicode2UTF8 "$0" "$1" "$2"
Pop $3
MessageBox MB_ICONINFORMATION|MB_OK "Result is : $3"

I tried various combinations for StrCpy $2 "AUTO":
Type:
"AUTO" - autodetect Unicode type
"UTF-8" - force Unicode type as UTF-8
"UTF-16LE" - force Unicode type as UTF-16LE
"UTF-16BE" - force Unicode type as UTF-16BE
But nothing worked

Last edited by pkonduru; 16th June 2022 at 17:49.
pkonduru is offline   Reply With Quote
Old 16th June 2022, 18:35   #10
pkonduru
Member
 
Join Date: Jul 2015
Posts: 86
I also tried trying to figure out what the plugin thinks my file is with this:
StrCpy $0 "$INSTDIR\install.log"


unicode::UnicodeType "$0"
Pop $1
MessageBox MB_ICONINFORMATION|MB_OK "Result is : $1"

The output is 6 which translates to:
"6" - input file couldn't be opened
pkonduru is offline   Reply With Quote
Old 17th June 2022, 00:28   #11
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,522
I suppose that plug-in is ANSI only.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
little endian, logging, utf-16

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