Escape / unescape text
text_escapeEscape or unescape text for JSON, HTML, URL, SQL, CSV, regex, shell, C/C++, Java, and Unicode targets, with options for quoting, delimiters, and output formats.
Instructions
Escape or unescape a string for a target: JSON (string body), JavaScript (incl. template literals), HTML, XML, URL (encodeURIComponent, optional form +), SQL (doubled quotes, optional MySQL backslashes and wrapping quotes), CSV field (RFC 4180; comma, semicolon or tab), regex, POSIX shell single quotes, C/C++, Java/C#, and Unicode escapes (\uXXXX, \u{X}, \UXXXXXXXX, &#xX;, U+XXXX). Options per target as on the website. Set "allTargets" to get the escaped form for every target at once. Web version: https://s3eidat.github.io/text-escape/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| form | No | url: form style, + for spaces. | |
| text | Yes | The text to escape, or the escaped text to unescape. | |
| wrap | No | sql: wrap in single quotes (unescape: strip them). | |
| ascii | No | json/js/html/c/java: also escape non-ASCII characters (c: as UTF-8 octal). | |
| every | No | unicode: escape every character, not only non-ASCII. | |
| mysql | No | sql: escape backslashes too (MySQL). | |
| named | No | html (with ascii): prefer named entities such as ©. | |
| target | Yes | Format: json, js, html, xml, url, sql, csv, regex, shell, c, java, unicode. | |
| delimiter | No | csv: field delimiter (comma, semicolon or tab). | , |
| direction | No | escape (default) or unescape. | escape |
| allTargets | No | escape only: also return the text escaped for every target. | |
| alwaysQuote | No | csv: always quote the field. | |
| unicodeFormat | No | unicode: u4 = \uXXXX (JS, JSON, Java), ubrace = \u{X} (ES6, Rust, Swift), u8 = \UXXXXXXXX (Python, C), html = &#xX;, uplus = U+XXXX. | u4 |