Created
September 16, 2013 19:05
-
-
Save leppie/6585049 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static unsafe CharUnicodeInfo() | |
{ | |
m_pDataTable = GlobalizationAssembly.GetGlobalizationResourceBytePtr(typeof(CharUnicodeInfo).Assembly, "charinfo.nlp"); | |
UnicodeDataHeader* pDataTable = (UnicodeDataHeader*) m_pDataTable; | |
m_pCategoryLevel1Index = (ushort*) (m_pDataTable + pDataTable->OffsetToCategoriesIndex); | |
m_pCategoriesValue = m_pDataTable + ((byte*) pDataTable->OffsetToCategoriesValue); | |
m_pNumericLevel1Index = (ushort*) (m_pDataTable + pDataTable->OffsetToNumbericIndex); | |
m_pNumericValues = m_pDataTable + ((byte*) pDataTable->OffsetToNumbericValue); | |
m_pDigitValues = (DigitValues*) (m_pDataTable + pDataTable->OffsetToDigitValue); | |
nativeInitTable(m_pDataTable); | |
} | |
internal static unsafe byte InternalGetCategoryValue(int ch, int offset) | |
{ | |
ushort num = m_pCategoryLevel1Index[ch >> 8]; | |
num = m_pCategoryLevel1Index[num + ((ch >> 4) & 15)]; | |
byte* numPtr = (byte*) (m_pCategoryLevel1Index + num); | |
byte num2 = numPtr[ch & 15]; | |
return m_pCategoriesValue[(num2 * 2) + offset]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment