Author Topic: Write to a Text File encoding  (Read 3081 times)

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Write to a Text File encoding
« on: November 09, 2017, 10:49:29 AM »
It looks like the "Write to a Text File" outputs a file that is encoded as UTF-8-BOM (BOM = byte order markup). If the output is a *.bat there appear to be issues with the output to the command window when the BOM is present.

As an example, if a batch file outputted from VA contains:
Code: [Select]
@echo off
echo hello world
timeout /t 5
...the command window's first line shows this when executing the batch file:


However if this same file is opened with Notepad++ and re-encoded as UTF-8 the output is the following:

So the first output line doesn't have the error and everything displays correctly.

Would it be possible to add some encoding options to the "Write to a Text File" action? Or maybe make the default encoding UTF-8?


EDIT by Pfeil: Default encoding was changed.
« Last Edit: April 18, 2020, 09:34:35 AM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Write to a Text File encoding
« Reply #1 on: November 09, 2017, 12:09:30 PM »
I can certainly check that out.  Thanks for the heads-up.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Write to a Text File encoding
« Reply #2 on: November 09, 2017, 04:55:19 PM »
Check out the latest beta and see if that gets you going.  Seems to work here ok ;)

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Write to a Text File encoding
« Reply #3 on: November 10, 2017, 08:32:55 AM »
Works perfectly! Thank you  ;D