From 759b0fd6a29455ff45e9ea4fd9eaee2fa1dfdff3 Mon Sep 17 00:00:00 2001 From: brazilofmux Date: Wed, 21 Feb 2007 01:25:37 +0000 Subject: [PATCH] -- 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 --- mux/src/stringutil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mux/src/stringutil.cpp b/mux/src/stringutil.cpp index 4330b7201..a8686d865 100644 --- a/mux/src/stringutil.cpp +++ b/mux/src/stringutil.cpp @@ -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;