Skip to content
  • Pascal Potvin's avatar
    daemon: add utf8_utils to check validity of utf-8 strings · 0843416c
    Pascal Potvin authored
    
    
    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>
    0843416c