qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v8 39/40] qapi: Support (subset of) \u escapes i


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v8 39/40] qapi: Support (subset of) \u escapes in strings
Date: Mon, 04 May 2015 20:04:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Eric Blake <address@hidden> writes:

> The handling of \ inside QAPI strings was less than ideal, and
> really only worked JSON's \/, \\, \", and our extension of \'
> (an obvious extension, when you realize we use '' instead of ""
> for strings).  For other things, like '\n', it resulted in a
> literal 'n' instead of a newline.
>
> Of course, at the moment, we really have no use for escaped
> characters, as QAPI has to map to C identifiers, and we currently
> support ASCII only for that.  But down the road, we may add
> support for default values for string parameters to a command
> or struct; if that happens, it would be nice to correctly support
> all JSON escape sequences, such as \n or \uXXXX.  This gets us
> closer, by supporting Unicode escapes in the ASCII range.
>
> Since JSON does not require \OCTAL or \xXX escapes, and our QMP
> implementation does not understand them either, I intentionally
> reject it here, but it would be an easy addition if we desired it.
> Likewise, intentionally refusing the NUL byte means we don't have
> to worry about C strings being shorter than the qapi input.
>
> Signed-off-by: Eric Blake <address@hidden>

Reviewed-by: Markus Armbruster <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]