mirror of
https://github.com/brazilofmux/tinymux
synced 2026-08-13 00:23:11 -04:00
-- 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:
parent
bdbd2ae00f
commit
759b0fd6a2
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue