From e93a12868d36f353bb6a1ca9cd076561b0c80fb8 Mon Sep 17 00:00:00 2001 From: crs Date: Tue, 23 Jul 2002 11:42:54 +0000 Subject: [PATCH] checkpoint. fixed cases for mbrtowc (was using 1 and 2 instead of -1 and -2). --- base/CUnicode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/CUnicode.cpp b/base/CUnicode.cpp index 45a3c7e8..a4a07038 100644 --- a/base/CUnicode.cpp +++ b/base/CUnicode.cpp @@ -299,14 +299,14 @@ CUnicode::textToUTF8(const CString& src, bool* errors) for (const char* scan = src.c_str(); n > 0 && *scan != 0; ) { size_t mblen = mbrtowc(NULL, scan, n, &state); switch (mblen) { - case (size_t)2: + case (size_t)-2: // incomplete last character. convert to unknown character. setError(errors); len += 1; n = 0; break; - case (size_t)1: + case (size_t)-1: // invalid character. count one unknown character and // start at the next byte. setError(errors);