source/AccessorySDK/Support/utfconv.c
static uint16_t
unicode_combine(uint16_t base, uint16_t combining)
{
	uint32_t value;

	/* Check HANGUL */
	if ((combining >= HANGUL_VBASE) && (combining < (HANGUL_TBASE + HANGUL_TCOUNT))) {
		/* 2 char Hangul sequences */
		if ((combining < (HANGUL_VBASE + HANGUL_VCOUNT)) &&
		    (base >= HANGUL_LBASE && base < (HANGUL_LBASE + HANGUL_LCOUNT))) {
		    return ((uint16_t)(HANGUL_SBASE +
		            ((base - HANGUL_LBASE)*(HANGUL_VCOUNT*HANGUL_TCOUNT)) +
		            ((combining  - HANGUL_VBASE)*HANGUL_TCOUNT)));
		}
	
		/* 3 char Hangul sequences */
		if ((combining > HANGUL_TBASE) &&
		    (base >= HANGUL_SBASE && base < (HANGUL_SBASE + HANGUL_SCOUNT))) {
			if ((base - HANGUL_SBASE) % HANGUL_TCOUNT)
				return (0);
			else
				return ((uint16_t)(base + (combining - HANGUL_TBASE)));
		}
	}

	value = getmappedvalue32(__CFUniCharPrecompSourceTable, __CFUniCharPrecompositionTableLength, combining);
	if (value) {
		value = getmappedvalue16(__CFUniCharBMPPrecompDestinationTable + (value & 0xFFFF), (value >> 16), base);
	}
	return ((uint16_t)value);
}
/*
 * unicode_combine - generate a precomposed Unicode char
 *
 * Precomposed Unicode characters are required for some volume
 * formats and network protocols.  unicode_combine will combine
 * a decomposed character sequence into a single precomposed
 * (composite) character.
 *
 * Similar toCFUniCharPrecomposeCharacter but unicode_combine
 * also handles Hangul Jamo characters.
 */
generate a precomposed Unicode char
Precomposed Unicode characters are required for some volume
formats and network protocols.  unicode_combine will combine
a decomposed character sequence into a single precomposed
(composite) character.

Similar toCFUniCharPrecomposeCharacter but unicode_combine
also handles Hangul Jamo characters.
generate a precomposed Unicode char Precomposed Unicode characters are required for some volume formats and network protocols . unicode_combine will combine a decomposed character sequence into a single precomposed ( composite ) character . Similar toCFUniCharPrecomposeCharacter but unicode_combine also handles Hangul Jamo characters .
static uint16_t
unicode_combine(uint16_t base, uint16_t combining)
{
	uint32_t value;
	if ((combining >= HANGUL_VBASE) && (combining < (HANGUL_TBASE + HANGUL_TCOUNT))) {
		if ((combining < (HANGUL_VBASE + HANGUL_VCOUNT)) &&
		    (base >= HANGUL_LBASE && base < (HANGUL_LBASE + HANGUL_LCOUNT))) {
		    return ((uint16_t)(HANGUL_SBASE +
		            ((base - HANGUL_LBASE)*(HANGUL_VCOUNT*HANGUL_TCOUNT)) +
		            ((combining  - HANGUL_VBASE)*HANGUL_TCOUNT)));
		}
		if ((combining > HANGUL_TBASE) &&
		    (base >= HANGUL_SBASE && base < (HANGUL_SBASE + HANGUL_SCOUNT))) {
			if ((base - HANGUL_SBASE) % HANGUL_TCOUNT)
				return (0);
			else
				return ((uint16_t)(base + (combining - HANGUL_TBASE)));
		}
	}
	value = getmappedvalue32(__CFUniCharPrecompSourceTable, __CFUniCharPrecompositionTableLength, combining);
	if (value) {
		value = getmappedvalue16(__CFUniCharBMPPrecompDestinationTable + (value & 0xFFFF), (value >> 16), base);
	}
	return ((uint16_t)value);
}
static uint16_t unicode_combine ( uint16_t base , uint16_t combining ) { uint32_t value ; if ( ( combining >= HANGUL_VBASE ) && ( combining < ( HANGUL_TBASE + HANGUL_TCOUNT ) ) ) { if ( ( combining < ( HANGUL_VBASE + HANGUL_VCOUNT ) ) && ( base >= HANGUL_LBASE && base < ( HANGUL_LBASE + HANGUL_LCOUNT ) ) ) { return ( ( uint16_t ) ( HANGUL_SBASE + ( ( base - HANGUL_LBASE ) * ( HANGUL_VCOUNT * HANGUL_TCOUNT ) ) + ( ( combining - HANGUL_VBASE ) * HANGUL_TCOUNT ) ) ) ; } if ( ( combining > HANGUL_TBASE ) && ( base >= HANGUL_SBASE && base < ( HANGUL_SBASE + HANGUL_SCOUNT ) ) ) { if ( ( base - HANGUL_SBASE ) % HANGUL_TCOUNT ) return ( 0 ) ; else return ( ( uint16_t ) ( base + ( combining - HANGUL_TBASE ) ) ) ; } } value = getmappedvalue32 ( __CFUniCharPrecompSourceTable , __CFUniCharPrecompositionTableLength , combining ) ; if ( value ) { value = getmappedvalue16 ( __CFUniCharBMPPrecompDestinationTable + ( value & 0xFFFF ) , ( value >> 16 ) , base ) ; } return ( ( uint16_t ) value ) ; }
unicode_combine - generate a precomposed Unicode char
 Precomposed Unicode characters are required for some volume
 formats and network protocols.
unicode_combine - generate a precomposed Unicode char Precomposed Unicode characters are required for some volume formats and network protocols .
/* Check HANGUL */ /* 2 char Hangul sequences */ /* 3 char Hangul sequences */