Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Encoding in Write to file action
Topic Summary: UTF-8 without BOM is possible?
Created On: 06/20/2018 11:46 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Hamid Noorbakhsh, on Tuesday, June 26, 2018 11:58 AM

Answer:
Hi Tetsuya,
Write to file uses StreamWriter which by default does not put a BOM and uses machine default encoding. However when an encoding is used, BOM is added so that encoding is enforced. (utf-8 can mistakenly be read as ascii also). Since we let the user choose the encoding, it is enforced, and therefore BOM is unavoidable. If we let Windows choose it's default, then dependent on locale it might choose ansi or utf-8. those will be without BOM, however, they are unpredictable on exactly what is chosen, and this might be OK for a single user, but files transferred across borders might not behave the same.
 06/20/2018 11:46 AM
User is offline View Users Profile Print this message

Author Icon
TetsuyaOka
Journeyman (50-99)

Posts: 58
Joined: 06/14/2010

Hello,

I'm trying to use "Write to file" action with UTF-8 encoding.
However, it looks like actual output data encoding is UTF-8 with BOM.

Is there any option or any workaround for UTF-8 without BOM?
I'd like to output the data as "UTF-8 without BOM" encoding.

Thanks and best regards,

 Category Survey
AutoMate 10 version: 10.2.0
Windows version: Windows Server 2012 R2
 06/22/2018 10:55 AM
User is offline View Users Profile Print this message

Author Icon
Alex Escalante
HelpSystems

Posts: 871
Joined: 02/26/2014

Hello Tetsuya,

Is it possible to test your issue on either 10.7 or 11.0.6?

 Category Survey


-------------------------

Alex Escalante | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 06/22/2018 11:13 AM
User is offline View Users Profile Print this message

Author Icon
TetsuyaOka
Journeyman (50-99)

Posts: 58
Joined: 06/14/2010

Hi Alex,

Thank you very much for your response.

Unfortunately, No.
We only have 10.2 for now.

Is version 10.6 or 10.7 has such a option?

Thanks again and best regards,

 Category Survey
AutoMate 10 version: 10.2.0
Windows version: Windows Server 2012 R2
 06/22/2018 02:22 PM
User is offline View Users Profile Print this message

Author Icon
TetsuyaOka
Journeyman (50-99)

Posts: 58
Joined: 06/14/2010

Hi Alex,

I have downloaded 10.7.0.3 and tested.
And confirmed that "Write to File" action with encode UTF-8 creates UTF-8 BOM data.

Please kindly find attached document.

So, is this Windows specification? or AutoMate specification?
I guess it looks like Windows specification, but please kindly advise.

Thanks and best regards,

 Category Survey
AutoMate 10 version: 10.2.0
Windows version: Windows Server 2012 R2


UTF8 BOM test.xlsx
UTF8 BOM test.xlsx  (182 KB)

 06/25/2018 02:12 PM
User is offline View Users Profile Print this message

Author Icon
TetsuyaOka
Journeyman (50-99)

Posts: 58
Joined: 06/14/2010

Hi Alex,

I have tested with AM11 and confirmed that "Write to File" action with encode UTF-8 creates UTF-8 BOM data.

Please kindly find attached document.

So, I assume there is no such a option (UTF-8 without BOM), but please confirm about this.

Thanks and best regards,

 Category Survey
AutoMate 10 version: 10.2.0
Windows version: Windows Server 2012 R2



 06/25/2018 03:06 PM
User is offline View Users Profile Print this message

Author Icon
Hamid Noorbakhsh
HelpSystems

Posts: 454
Joined: 07/29/2008

Answer Answer
Hi Tetsuya,
Write to file uses StreamWriter which by default does not put a BOM and uses machine default encoding. However when an encoding is used, BOM is added so that encoding is enforced. (utf-8 can mistakenly be read as ascii also). Since we let the user choose the encoding, it is enforced, and therefore BOM is unavoidable. If we let Windows choose it's default, then dependent on locale it might choose ansi or utf-8. those will be without BOM, however, they are unpredictable on exactly what is chosen, and this might be OK for a single user, but files transferred across borders might not behave the same.

 Category Survey
AutoMate 10 version:
Windows version:


-------------------------
Thank you for choosing AutoMate

Hamid Noorbakhsh | Senior Software Engineer
AutoMate | A Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700

Edited: 06/25/2018 at 03:20 PM by Hamid Noorbakhsh
 06/26/2018 11:58 AM
User is offline View Users Profile Print this message

Author Icon
TetsuyaOka
Journeyman (50-99)

Posts: 58
Joined: 06/14/2010

Hello Hamid,

Thank you very much for your explanation and I understood that.

Best regards,

 Category Survey
AutoMate 10 version: 10.2.0
Windows version: Windows Server 2012 R2
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 656 guests browsing this forum, which makes a total of 656 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog