Skip to content
Snippets Groups Projects
Commit 0843416c authored by Pascal Potvin's avatar Pascal Potvin
Browse files

daemon: add utf8_utils to check validity of utf-8 strings


Based on work already existing in glib and dbus, two new functions to validate
and reformat utf-8 strings are added:

 * utf8_validate: returns true if the `char` sequence is valid utf-8.

 * utf8_make_valid: transforms an invalid utf-8 sequence into a valid one,
   by replacing each bad byte by U+FFFD REPLACEMENT CHARACTER. The same
   behaviour is implemented in other GNOME applications.

These two new functions are used in sip_utils::parseDisplayName().

Change-Id: Ie9a6c35b4df7883637374c325b05b6cf875f6b12
Signed-off-by: default avatarPascal Potvin <pascal.potvin@extenway.com>
parent 8df0b8a0
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment