[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>
- [Qemu-devel] [PATCH v8 34/40] qapi: Drop inline nested struct in query-version, (continued)
- [Qemu-devel] [PATCH v8 34/40] qapi: Drop inline nested struct in query-version, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 32/40] qapi: Merge UserDefTwo and UserDefNested in tests, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 24/40] qapi: More rigourous checking of types, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 37/40] qapi: Drop dead visitor code related to nested structs, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 35/40] qapi: Drop inline nested structs in query-pci, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 40/40] qapi: Check for member name conflicts with a base class, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 33/40] qapi: Drop tests for inline nested structs, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 39/40] qapi: Support (subset of) \u escapes in strings, Eric Blake, 2015/05/04
- Re: [Qemu-devel] [PATCH v8 39/40] qapi: Support (subset of) \u escapes in strings,
Markus Armbruster <=
- [Qemu-devel] [PATCH v8 30/40] qapi: Use 'struct' instead of 'type' in schema, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 38/40] qapi: Tweak doc references to QMP when QGA is also meant, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 06/40] qapi: Add some enum tests, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 01/40] qapi: Add copyright declaration on docs, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 02/40] qapi: Document type-safety considerations, Eric Blake, 2015/05/04
- [Qemu-devel] [PATCH v8 08/40] qapi: Add some union tests, Eric Blake, 2015/05/04
- Re: [Qemu-devel] [PATCH v8 00/40] drop qapi nested structs, Markus Armbruster, 2015/05/04