gvariant: Document differences between GVariant bytestrings and arrays

https://gitlab.gnome.org/GNOME/glib/issues/896
This commit is contained in:
Philip Withnall 2014-07-01 17:37:07 +01:00
parent 09419fdeb4
commit 5e46a97ac6
2 changed files with 5 additions and 2 deletions

View File

@ -563,7 +563,10 @@
<title>Bytestrings</title>
<para>
The bytestring syntax is a piece of syntactic sugar meant to complement the bytestring APIs in GVariant. It
constructs arrays of non-nul bytes (type '<literal>ay</literal>') with a nul terminator at the end.
constructs arrays of non-nul bytes (type '<literal>ay</literal>') with a nul terminator at the end. These are
normal C strings with no particular encoding enforced, so the bytes may not be valid UTF-8.
Bytestrings are a special case of byte arrays; byte arrays (also type '<literal>ay</literal>'), in the general
case, can contain nul at any position, and need not end with nul.
</para>
<para>
Bytestrings are specified with either <literal>b""</literal> or <literal>b''</literal>. As with strings,

View File

@ -984,7 +984,7 @@ data = g_variant_new_parsed ("(%o, {'brightness': {'value': <%i>, 'max': <%i>}})
<para>
The '<literal>^</literal>' character currently supports conversion to and from bytestrings or to and from arrays
of strings or bytestrings. It has a number of forms.
of strings or bytestrings. It does not support byte arrays. It has a number of forms.
</para>
<para>