When editing a data entry or batch application, or while using CSCode, select
Code ->
String Encoder. A dialog is shown that facilitates working with
string literals by encoding and decoding text into a variety of string literal formats.
The String Encoder dialog allows you enter text in one of four formats and to see the text encoded in the other three formats:
The text in each section is updated as you type, and if there is an error parsing the text, the error is displayed in red above the text.
The
Copy button copies the text in that section to the clipboard. Within CSPro logic, the
encode function can convert text to JSON string and percent encoding formats.
A few options allow you to control the encoding:
- CSPro Logic: Split newlines across multiple lines: If checked, newlines in the text input will be split on multiple lines for readability, resulting in multiple string literals that are automatically concatenated by the CSPro compiler. This option is enabled only when using logic version CSPro 8.0+.
- CSPro Logic: Use verbatim string literals: If checked, the text will be encoded as a verbatim string literal. This option is enabled only when using logic version CSPro 8.0+.
- JSON: Escape forward slashes: Forward slashes in JSON strings do not need to be escaped, but many libraries do escape such characters. If checked, forward slashes are escaped.