/* We don't ifdef-out the fallback code such that compiler always
* sees it and makes sure it's compilable. */
+ if (!a || !b)
+ return FALSE;
+
gchar utf8[12];
gchar *normalized;
gint len;
} else if (len == 2) {
*a = g_utf8_get_char (normalized);
*b = g_utf8_get_char (g_utf8_next_char (normalized));
+ /* Here's the ugly part: if ab decomposes to a single character and
+ * that character decomposes again, we have to detect that and undo
+ * the second part :-(. */
+ gchar *recomposed = g_utf8_normalize (normalized, -1, G_NORMALIZE_NFC);
+ hb_codepoint_t c = g_utf8_get_char (recomposed);
+ if (c != ab && c != *a) {
+ *a = c;
+ *b = 0;
+ }
+ g_free (recomposed);
ret = TRUE;
} else {
/* If decomposed to more than two characters, take the last one,