Skip to content

gvariant: Fix documentation for g_variant_get_string() to match reality

Philip Withnall requested to merge pwithnall/glib:variant-get-string-docs into master

The implementation didn’t match the documentation. The implementation has the right behaviour (wrt not allowing embedded nuls, validating UTF-8, and returning a default value if an invalid string is detected), so keep that and fix the documentation to match.

The GVariant specification is incorrect on this point, and the implementation of GLib was purposefully changed after the specification was published (but before GVariant became API-stable in GLib). The behaviour in GLib (specifically concerning all strings being in UTF-8) is consistent with D-Bus.

Spotted by William Manley.

Signed-off-by: Philip Withnall withnall@endlessm.com

Merge request reports