Old 18th October 2019, 16:15   #1
perdrix
Junior Member
 
Join Date: Jun 2019
Posts: 12
Display of readme file

When NSIS displays the readme file it doesn't cope very well with none US-ASCII characters.

For example I'd included a Russian name (Михаил Тимофеев using Cyrillic characters) in my (mostly) English readme and it just got completely messed up (

Do you think you could update the code so unicode files (UTF-8/16) will display correctly?

Thanks
David
perdrix is offline   Reply With Quote
Old 18th October 2019, 17:28   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,185
If it is a plain .txt file then yes, you should build a Unicode installer (Unicode True) and use a UTF 8 or 16 encoded .txt file.

In a ANSI installer, the Russian text will only display correctly on Russian systems (technically, the default codepage on the system needs to be set to something that supports those characters).

If you are using a .rtf file then I assume it should work automatically as long as your editor encodes non-ASCII characters as Unicode with the correct RTF syntax.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 28th October 2019, 14:35   #3
perdrix
Junior Member
 
Join Date: Jun 2019
Posts: 12
I added a line

Unicode True

at the front of my script, but the readme display was still incorrect it displayed:

Михаил Тимофеев instead of Михаил Тимофеев

This was using:

code:
##!include "MUI2.nsh"
!verbose 4

# Want to display Unicode readme
Unicode True

SetCompressor /SOLID lzma

!include "MUI.nsh"
!include "MUI_EXTRAPAGES.nsh"



and
code:

!insertmacro MUI_PAGE_README "${DSS_README_FILE}"



to display the readme file. What did I do wrong?

Thanks
David
perdrix is offline   Reply With Quote
Old 28th October 2019, 15:33   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,185
The readme needs a BOM, in Notepad it is called Unicode in the Save As dialog.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 3rd November 2019, 14:41   #5
perdrix
Junior Member
 
Join Date: Jun 2019
Posts: 12
YES! Thank you (on Windows 10 that is UTF8 with BOM), and it now works a treat!

David
perdrix is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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