Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8531845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:34:46+00:00 2026-06-11T09:34:46+00:00

I am using NSIS Unicode version and I am trying to append a string

  • 0

I am using NSIS Unicode version and I am trying to append a string to an existing Unicode file(UTF-16LE).

My Problem: After I write the string to the file then open the file, the string I wrote is just jibberish. I have a feeling that its trying to write an ANSI string to a UTF-16LE file.

How can I write a string to a unicode file?

Function ${prefix}AppendFile 
    # Note: Will automatically create file if it doesn't exist
    # $0 = fName
    # $1 = strToWrite

    Pop $1
    Pop $0

    ClearErrors
    FileOpen  $3 $0 a
    FileSeek  $3 0 END
    FileWrite $3 "$\r$\n"        # write a new line
    FileWrite $3 "$1"
    FileWrite $3 "$\r$\n"        # write an extra line
    FileClose $3                 # close the file

    IfErrors 0 +2
        MessageBox MB_OK "Append Error: $1 $\r$\n$\r$\n$0"
FunctionEnd
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:34:47+00:00Added an answer on June 11, 2026 at 9:34 am

    If you’re dealing with UTF-16LE file, you need to use FileWriteUTF16LE, which writes Unicode text, rather than FileWrite, which writes ANSI text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an exe file using NSIS script, in my script
I am trying to overwrite an existing value in my Application .config file using
Is there a way to identify the current version of IIS / using NSIS
I want to copy war file to tomcat web-app directory using NSIS setup. I
I have a rather large project whose Installer is written using NSIS. My problem
I'm able to generate patch files from one version to another using NSIS' Vpatch.
I'm trying to create a post install configuration page in my nsis script using
I'm using NSIS to a installer of other install. After copy all the files
At the moment I am using: SetOutPath $INSTDIR\folder\subfolder File /r ..\Output\*.* The problem is
I'm trying to create an installer using NSIS Modern User Interface for the first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.