No mapping for the Unicode character exists in the target multi-byte code page – The file must be in UTF-8 or UTF-16 encoding.

You get this error message, when you try to execute a script that does not use a valid UTF-8 (or UTF-16) encoding.

Older versions of WinSCP used legacy ANSI encoding, when the script file does not have UTF-8 (or UTF-16) byte order mark (BOM). The recent versions of WinSCP default to UTF-8 encoding, when no BOM is present. If you have a script written in ANSI encoding for an old version of WinSCP, you have to convert it to UTF-8 (or UTF-16) encoding, when upgrading to a recent version of WinSCP.

Advertisement

A simple way to convert the script encoding is:

  • Open the script in Notepad;
  • Go to File > Save As;
  • Change Encoding from ANSI to UTF-8;
  • Click Save.

Last modified: by martin