language-extensions/R/common/src/Unicode.cpp
// -------------------------------------------------------------------------------------------------
// Name: GetChar8Len
//
// Description:
//  Gets the length of the UTF8 representation of a UTF32 character
//
GetChar8Len
Description:
Gets the length of the UTF8 representation of a UTF32 character
GetChar8Len Description : Gets the length of the UTF8 representation of a UTF32 character
static inline size_t
GetChar8Len(char32_t char32) noexcept
{
	size_t ans;
	if (char32 < 0x80)
	{
		ans = OneChar8Len;
	}
	else if (char32 < 0x800)
	{
		ans = TwoChar8Len;
	}
	else if (char32 < 0x10000)
	{
		ans = ThreeChar8Len;
	}
	else
	{
		ans = FourChar8Len;
	}
	return ans;
}
static inline size_t GetChar8Len ( char32_t char32 ) noexcept { size_t ans ; if ( char32 < 0x80 ) { ans = OneChar8Len ; } else if ( char32 < 0x800 ) { ans = TwoChar8Len ; } else if ( char32 < 0x10000 ) { ans = ThreeChar8Len ; } else { ans = FourChar8Len ; } return ans ; }
Name: GetChar8Len
Description:
Gets the length of the UTF8 representation of a UTF32 character
Name : GetChar8Len Description : Gets the length of the UTF8 representation of a UTF32 character