Go Back
Escape Unicode characters for JSON, XML and more...
Publisher
: Lingk
Run In Lingk
Description
This recipe encodes Unicode characters to JSON compatible strings. To use this recipe, click Run!
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - ESCAPE UNICODE CHARACTERS FOR JSON, XML AND MORE... # Recipe URL - https://app.lingk.io/a/10932/tf/17858 # Description - # This recipe encodes Unicode characters to JSON compatible strings # To use this recipe, click Run! # Industry - Higher Ed # Business Process - Graduate Reporting # Systems - # Connectors - JSON # Data Flows - Single Direction # Connection Type - JSON # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # JSON Setup - https://help.lingk.io/en/articles/74-json-connector-reference ###### Start: JSON Connectors ####### # Source data - name: sourceLeadData type: json properties: jsonObject: > [ { "leadId": "1", "firstName": "John", "lastName": "Chávez", "leadScore": 88 }, { "leadId": "2", "firstName": "Anne", "lastName": "Jacobs", "leadScore": 32 } ] - name: outputUnicodeJSON type: json parameterizedBy: transformedData properties: jsonObject: | {{var|tojson}} ###### End: JSON Connectors ####### # Note: You also have access to Jinjava filters # {{var.firstname|escapejson}} # will escape data in the connector configuration # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory # The reflect method can utilize any of the methods and static objects in org.apache.commons.text statements: #******************************************************************** D I S C L A I M E R *********************************************************************************************** # * # Note that in an effort to keep recipes optimized for DPH (Data Processing Hours), print statements should be commented out after development has concluded for a recipe. * # For more information on DPH optimization, please visit the following help article - https://help.lingk.io/en/articles/212-minimizing-data-processing-hours-on-the-lingk-platform * # * #******************************************************************** D I S C L A I M E R *********************************************************************************************** - statement: (test) => SELECT reflect('org.apache.commons.text.StringEscapeUtils', 'escapeJson', 'Chávez') output #- statement: print test # The reflect method can utilize any of the methods and static objects in org.apache.commons.text - statement: | (transformedData) => select leadId lead_id, reflect('org.apache.commons.text.StringEscapeUtils', 'escapeJson',lastName) last_name from sourceLeadData #- statement: print transformedData - statement: refresh outputUnicodeJSON #- statement: print outputUnicodeJSON # Add more statements to convert, join, aggregrate, transform, and integrate your data
Fixed Width Data Processing
Amazon S3 Lambda File Trigger to Ethos Person Import