Support of ESC character

Alexei BARANTSEV's Avatar

Alexei BARANTSEV

21 Feb, 2019 03:18 PM

Hello,

Your parser supports various lexical elements like '\n', '\t", etc.
There is one more element '\e' in GNU extension, see https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.pdf, page 9.
It is the ESC control character (27 dec or 1B hex) that is often used by printers to manage font styles.
I would like to use the dictionary like:
char *ctx = "{\"hello\" : \"Bonjour\",\"boldOn\" : \"\\eE\", \"boldOff\" : \"\\eF\"}";
And when I used it the result is empty.
To fix it I added one more case in the function process_string in the file parson.c:

case 'e':
*output_ptr = '\e';
break;

After that I have no problem.
Please include this modification into the next release.

    Best regards
    Alexei BARANTSEV

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac