-- State Machine in ConvertToLatin() may not advance to the end of the code

point, so that has to be handled separately.

git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1213 d1b986fa-651c-0410-a323-35a8662cf44d
This commit is contained in:
brazilofmux 2007-02-21 01:25:37 +00:00 committed by Brazil
parent bdbd2ae00f
commit 759b0fd6a2

View file

@ -728,13 +728,15 @@ const char *ConvertToLatin(const UTF8 *pString)
while ('\0' != *pString)
{
const UTF8 *p = pString;
int iState = LATIN_START_STATE;
do
{
unsigned char ch = *pString++;
unsigned char ch = *p++;
iState = latin_stt[iState][latin_itt[(unsigned char)ch]];
} while (iState < LATIN_ACCEPTING_STATES_START);
*q++ = (char)(iState - LATIN_ACCEPTING_STATES_START);
pString = utf8_NextCodePoint(pString);
}
*q = '\0';
return buffer;