normalize
Description:
[ CCode ( cname = "g_utf8_normalize" ) ]
public string normalize (ssize_t len = -1, NormalizeMode mode = DEFAULT)
public string normalize (ssize_t len = -1, NormalizeMode mode = DEFAULT)
Example: Utf8-handling, normalization:
public static int main (string[] args) {
string str1 = "\xE2\x84\xAB";
string str2 = "\x41\xCC\x8A";
// Output: ``"Å", "Å"``
print ("\"%s\", \"%s\"\n", str1, str2);
// Output: ``false``
bool res = (str1 == str2);
print ("%s\n", res.to_string ());
// Output: ``true``
str1 = str1.normalize ();
str2 = str2.normalize ();
res = (str1 == str2);
print ("%s\n", res.to_string ());
return 0;
}
valac --pkg glib-2.0 string.normalize.vala