Forum Discussion

Harsha3's avatar
Harsha3
New Contributor III
5 years ago

Saving csv in UTF-8 by default

Hi Gooday,

I have a requirement to save the csv file in UTF-8 by default . However in csv formatter we have UTF-8 encoding option , on writing the file in “File Writer” using externsion.csv it is getting saved as comma delimited . However, the format / data are preserved while editing in notepad , but on downloading and opening , the data format is getting changed as it is a special character. So please let us know is there any option to achieve this.

Thanks,
Harshavardhana

9 Replies

  • Harsha3's avatar
    Harsha3
    New Contributor III

    Hi ,

    Please let me know if I can attach the screenshot here.

  • Harsha3's avatar
    Harsha3
    New Contributor III

    Hi Dmiller,

    These are some sample files below with Taiwanese characters.

    If I open one of the files as highlighted in yellow in edit mode these characters were preserved.

    But if I download/ directly open the file these characters are changed.

    This is because though the characters are in UTF-8 as defined in csv formatter , on saving the csv it is by default comma delimited.

    How to by default change this to UTF-8 while writing the files in csv .

    Thanks,
    Harshavardhana

    • ptaylor's avatar
      ptaylor
      Employee

      Can you please clarify the context for each of these screenshots? It’s unclear what each is showing.

      Where are you seeing the list of files in the first screenshot? What produced those files? Snaps?

      When you say “If I open one of the files as highlighted in yellow in edit mode”, what exactly do you mean? Opening where/how?

      When you say “But if I download/ directly open”, what do you mean by that? Download from where? What’s the difference between “open” and “directly open”?

      • Harsha3's avatar
        Harsha3
        New Contributor III

        Hi Ptaylor,

        We are writing a csv file in a file writer using snap in the smb path . Let me share the property of csv formatter and file writer.

        CSV FORMATTER:

        File writer:

        So the files from these snaps are generated and placed in the smb path as mentioned in the file writer expression.

        My concern is after these files were getting placed in the server , if you simply open the file by double click the inside Vietnamese/Taiwanese characters are changing .

        I mentioned like on editing it is proper . I just right clicked and click on the edit option , the contents are opened in notepad where we could see these characters are preserved.

        The reason I mentioned above was these csv files are saved in comma delimited . I wanted to save them in the path using CSV -UTF-8 format in the path

        So wanted to know is that possible.

        Thanks,
        Harshavardhana

  • darshthakkar's avatar
    darshthakkar
    Valued Contributor

    @joel_bourgault: Thanks for sharing your insights, I have faced similar issue with CSV files, I will give it a try.
    I wasn’t able to find a solution thus I went with generating an excel file and doing the manual work of getting it converted to UTF-8.