mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-24 19:28:56 +01:00
Make g_utf8_make_valid optionally take a length
g_utf8_make_valid was turned into a public API this cycle. However now that it is public we should make the API more generic, allowing the caller to specify the length. This is especially useful if the function is called with a string that has \0 in the middle or for chunks of a strings that are not nul terminated. This is also consistent with most of the other utf8 utils. Callers inside glib are updated to the new signature. https://bugzilla.gnome.org/show_bug.cgi?id=779456
This commit is contained in:
committed by
Ignacio Casal Quinteiro
parent
9aaf7588fc
commit
f559bc01dc
@@ -885,7 +885,8 @@ gchar *g_utf8_collate_key_for_filename (const gchar *str,
|
||||
gssize len) G_GNUC_MALLOC;
|
||||
|
||||
GLIB_AVAILABLE_IN_2_52
|
||||
gchar *g_utf8_make_valid (const gchar *str);
|
||||
gchar *g_utf8_make_valid (const gchar *str,
|
||||
gssize len) G_GNUC_MALLOC;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user