• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
      • Introduction to CSPro Language
      • Data Requirements
      • CSPro Program Structure
      • Programming Standards
      • Code Folding
      • Debugging CSPro Applications
      • Declaration Section
      • Procedural Sections
      • Logic
        • View Logic
        • Create and Edit Logic
        • Find and Replace Logic
        • Compile Logic / An Application
        • OnKey Character Map
        • OnViewQuestionnaire Global Function
        • User and Configuration Settings
        • String Encoder Dialog
        • Path Adjuster Dialog
        • Symbol Analysis
      • Language Elements
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

String Encoder Dialog

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:
  • Text
  • CSPro Logic
  • JSON String
  • Percent Encoding (used in connection strings)
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.
See also: String Literals, Path Adjuster Dialog, Encode Function