What's a string conversion?
String conversion (string) Escaping) is the process of replacing character in programming and data exchange with a specific " transposition sequence " for the purpose of expressing character of special significance within a string (e.g. quotation marks, line breaks, back slash, etc.). Inverting is the process by which you restore it to the original character.
Different languages and formats have different transposition rules. For example, in JSON, the double quote sign must be changed to `\ ' ; On HTML , less than < `shall be changed to < ` to prevent the browser from deconstructing to label.
Why do you need a diversion?
- Prevent grammar error: When defining a string in the code, the string itself contains quotation marks, which if not transposed will cause the compiler or interpreter to report the error.
- Data security (XSS protection): HTML must be performed before rendering user-generated content to a web page Transferred to prevent malicious scripts from being injected into attack (cross-site script attack, XSS).
- Network transfer: URL Encoding ensures that illegal characters (e.g. spaces, Chinese characters) are safe at HTTP Requesting transmission.
- Debug assist: When looking at logs or API returns values, the programmer often needs to manually restore long strings after conversion to readable format.
Supported conversion mode details
- JSON: Follows the RFC 8259 standard for handling control characters and quotation marks in the JSON string. `body ' often used to process API field.
- JavaScript / Java: Process single quotes, double quotes, line breaks and Unicode transliteration sequences. Applicable to in Java or JS Codes are embedded in multiple rows of text.
- HTML Entity: Converts the special symbol to ` &...; ' Form. Except for basic `< > & " `, also supports some common Western European special symbol conversions.
- URL encoding: Encoding components using the percent number code (Percent-encoding) to make URLs contain illegal characters.
- CSV: Rules for handling comma-separated value files, if they contain comma, line breaks or double quotation marks, are then placed in a double quotation and the internal quotation is multiplied.
How to use this tool?
1. Select the ** conversion format required in the above navigation bar** (e.g. HTML).
2. Select the type of operation:** transposition** (original coding)** or invertion** (coding original).
3. Enter text in the first input box, and the results are displayed in the second input box immediately.
Click on the Copy Results to save the results to the clipboard for your code or document.