language-extensions/R/common/src/Unicode.cpp
// -------------------------------------------------------------------------------------------------
// Name: GetChar16Len
//
// Description:
//  Gets the length of the UTF16 representation of a UTF32 character
//
GetChar16Len
Description:
Gets the length of the UTF16 representation of a UTF32 character
GetChar16Len Description : Gets the length of the UTF16 representation of a UTF32 character
static inline size_t
GetChar16Len(char32_t char32)
{
	size_t ans;
	if (char32 <= 0xdf77 || (char32 >= 0xe000 && char32 <= 0xffff))
	{
		ans = OneChar16Len;
	}
	else if (char32 >= 0x10000 && char32 <= 0x10ffff)
	{
		ans = TwoChar16Len;
	}
	else
	{
		ans = OneChar16Len;
	}
	return ans;
}
static inline size_t GetChar16Len ( char32_t char32 ) { size_t ans ; if ( char32 <= 0xdf77 || ( char32 >= 0xe000 && char32 <= 0xffff ) ) { ans = OneChar16Len ; } else if ( char32 >= 0x10000 && char32 <= 0x10ffff ) { ans = TwoChar16Len ; } else { ans = OneChar16Len ; } return ans ; }
Name: GetChar16Len
Description:
Gets the length of the UTF16 representation of a UTF32 character
Name : GetChar16Len Description : Gets the length of the UTF16 representation of a UTF32 character
// Bad character //