Bad text encoding error is reported during the packaging of electric builder

When using Electron Builder for packaging, you may encounter an error Bad text encoding, Error in script "<stdin>" on line 77 -- exporting creation process, which causes packaging failure.

text

Issue Log

 ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Processing script file: "<stdin>" (ACP) Error output: Bad text encoding Error in script "<stdin>" on line 77 -- aborting creation process

Keywords: ERR_ELECTRON_BUILDER_CANNOT_EXECUTE, Bad text encoding, Error in script "<stdin>" on line 77

Causes

Text encoding error. Makensis is not set to UTF-8 character set.

For possible values of node awareness, please refer to:
https://github.com/idleberg/node-makensis#inputcharset

resolvent

open node_module/app-builder-lib/out/targets/nsis/NsisTarget.js File, add the parameters we need to the executeMakensis method.

 //node_module/app-builder-lib/out/targets/nsis/NsisTarget.js async executeMakensis(defines, commands, script) { const args = this.options.warningsAsErrors === false ?  [] : ["-WX"]; //Add here args.push("-INPUTCHARSET", "UTF8"); //End for (const name of Object.keys(defines)) { const value = defines[name]; if (value == null) { args.push(`-D${name}`); } else { args.push(`-D${name}=${value}`); } }
Zimiao haunting blog (azimiao. com) All rights reserved. Please note the link when reprinting: https://www.azimiao.com/6250.html
Welcome to the Zimiao haunting blog exchange group: three hundred and thirteen million seven hundred and thirty-two thousand

Comment

*

*

Comment area

  1. jojo 07-18 00:06 reply

    Although I didn't find anything useful for me, the page is very good