C Example: JSON String Escaping: quotes, backslashes, newlines and control bytes
Escapes and unescapes JSON strings: quotes and backslashes get a leading backslash; newline, carriage return, tab, backspace and form feed use short escapes such as \n; other control bytes become \u00XX. The decoder restores everything and checks the round trip — a foundation for building JSON, logs and API payloads.
🖥 Run OnlineGCC 10.2 · C11 standard · click ▶ to run · Copy code
🖨 Reference OutputMatches the online run in a standard C11 environment
raw : He said "C" path: C:\temp escaped : He said \"C\"\n\tpath: C:\\temp unescaped: He said "C" path: C:\temp match : OK
🧩 Keep Learning