/* @uc should be 0xD800..0xDBFF, and @lc should be 0xDC00..0xDFFF. If they aren't, this function returns false.  */
static bool from_surrogate_pair(uint16_t uc, uint16_t lc, uchar_t *unicode)
/* @uc should be 0xD800..0xDBFF, and @lc should be 0xDC00..0xDFFF. If they aren't, this function returns false.  */
static bool from_surrogate_pair(uint16_t uc, uint16_t lc, uchar_t *unicode)
{
	if (uc >= 0xD800 && uc <= 0xDBFF && lc >= 0xDC00 && lc <= 0xDFFF) {
		*unicode = 0x10000 + ((((uchar_t)uc & 0x3FF) << 10) | (lc & 0x3FF));
		return true;
	} else {
		return false;
	}
}