Forum moved here!

Home / The printer name contains non-ascii characters and cannot be printed normally?

sujiewen

The printer name contains non-ascii characters and cannot be printed normally?

Error: Command failed: D:\wms\WMSWarehouse\resources\app.asar.unpacked\SumatraPDF.exe -print-to Brother MFC-7880DN Printer (���� 1) -print-settings “1x” -silent C:\Users\XXXX\AppData\Roaming\wmswarehouse\Cache\files0iw2v8.png

GitHubRulesOK

Whilst running the command as you show you are in the command console outside SumatraPDF thus windows console Unicode is normally the source of the problem.

First check the source command line is not simple ansi (if using notepad to write a cmd/bat file try save as UTF-8) also remove -silent to see any error message as to what the real reason is.

The easiest solution might be to rename the printer or create a duplicate systemwide entry, for example “Printer 888”

The next way is to try and get Windows Console to accept Unicode using Chcp 65001 in each related .Bat/Cmd, However as a workaround (that affects the system) you need to

  1. store current chcp via the cmd
  2. change chcp via the cmd
  3. run the command with unicode entries and ensure completion
  4. restore chcp via the same cmd without exit due any break / failure above.