From fd5e476dbb9245a9ec755eeaa5b0e4b4556d2f8c Mon Sep 17 00:00:00 2001 From: Ryan Norton Date: Sun, 31 Oct 2004 06:23:16 +0000 Subject: [PATCH] note broken code, cast hack to fix warning on pickier compilers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 06ec99a71e..dfd5295d29 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -473,7 +473,7 @@ size_t wxMBConvUTF7::WC2MB(char *buf, const wchar_t len++; } #ifndef WC_UTF16 - else if (cc > 0xffff) + else if (cc > ((const wchar_t)0xffff)) { // no surrogate pair generation (yet?) return (size_t)-1; @@ -2334,6 +2334,13 @@ public: return res ; } + //NB: This is _broken_ - in invalid conversions, instead of returning -1 + //like it should, it (sometimes?) converts invalid characters of the encoding to a question + //mark character '?'. + // + //We need to do the msw double-pass check for the question marks as Vadim + //lines out above (RN: I don't recall this happening in the core foundation version, + //but it might do it there also, ick) size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const { OSStatus status = noErr ; -- 2.45.2