[CSVUtil] Export Text Encode ANSI

Forge Component
(24)
Published on 2017-10-09 by Wei Zhu
24 votes
Published on 2017-10-09 by Wei Zhu

Your component has an encode parameter, but I do not quite understand how it is used. I need to export a text file like ANSI or UTF-8 how do I put this in the parameter? What does he accept?


Tanks


Clayton Anderson

These are the valid values for that 

  • noquote_nocheck
  • noquote
  • quote
  • auto

which controls whether to use quotes as delimiters for strings

The ExportRecordList2CSV action returns a Text type. Then convert the text to binary using TextToBinaryData, which accepts an Encoding parameter, set it to "utf-8" or "ascii"

Hi Clayton


Like Jonathan said,  ExportRecordList2CSV  return Text type.

You need use TextToBinaryData convert it to BinaryData, and you can specify Encode parameter at that time.

Jonathan Lui wrote:

These are the valid values for that 

  • noquote_nocheck
  • noquote
  • quote
  • auto

which controls whether to use quotes as delimiters for strings

The ExportRecordList2CSV action returns a Text type. Then convert the text to binary using TextToBinaryData, which accepts an Encoding parameter, set it to "utf-8" or "ascii"

Hi Jonathan


Usually CSV need escape special character such as double quote or CR+LF.

This parameter is used to control behavior of escape.

  • auto:  Automatically escape if need (This is Default value)
  • quote: ALWAYS escape
  • noquote: DO NOT escape but will throw exception if there are special character included
  • noquote_nocheck: DO NOT escape

Wei Zhu wrote:

Jonathan Lui wrote:

These are the valid values for that 

  • noquote_nocheck
  • noquote
  • quote
  • auto

which controls whether to use quotes as delimiters for strings

The ExportRecordList2CSV action returns a Text type. Then convert the text to binary using TextToBinaryData, which accepts an Encoding parameter, set it to "utf-8" or "ascii"

Hi Jonathan


Usually CSV need escape special character such as double quote or CR+LF.

This parameter is used to control behavior of escape.

  • auto:  Automatically escape if need (This is Default value)
  • quote: ALWAYS escape
  • noquote: DO NOT escape but will throw exception if there are special character included
  • noquote_nocheck: DO NOT escape

I stand corrected. Thank you, I've only used auto before, now I know what each option means.