Can I change the character encoding of the CSV file output by the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2022 01:13 AM
I have a requirement to output and save scripts in CSV.
I used this article to output to CSV, but the character encoding is output in UTF-8.
Is there any way to output CSV in shift-JIS?
<Reference article>
Generate CSV file through script
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2022 03:27 AM
Hi, the post you have referenced is creating a string of values separated by commas then saving this as a csv attachment, and you may need to clarify your requirements as your intentions are not clear. You can set a default char set for csv exports, but I don’t believe that you can change the char set that GlideSysAttachment saves files as.
Have you tried updating the csv export char set ?
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0538309
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2022 01:24 AM
Thank you for your response.
I need to present table information to a customer using a service catalog, narrowed down to specific columns.
I was looking for a way to export the table information to CSV as a preliminary step.
I have tried implementing the update to the csv export character set you suggested, but it did not change the results output by GlideSysAttachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 01:00 AM
Hi, I would suspect that the csv export char set applies to csv's that are generated as part of a right click 'export' function against a table and not against the download of an existing csv which I think is your scenario. I would recommend you test the 'export csv' from any table, if it generates a result in suitable format you may then be able to use a scheduled report to export your data.