From 246428310e0924dd9332187a51ad68f5932ac7a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 24 Oct 2003 19:25:48 +0000 Subject: [PATCH] fixed iso-8859-1 handling to report failures git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index f13005cb37..840a24d54b 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -1483,7 +1483,19 @@ size_t wxCSConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const if (buf) { for (size_t c = 0; c <= len; c++) - buf[c] = (psz[c] > 0xff) ? '?' : psz[c]; + { + if (psz[c] > 0xFF) + return (size_t)-1; + buf[c] = psz[c]; + } + } + else + { + for (size_t c = 0; c <= len; c++) + { + if (psz[c] > 0xFF) + return (size_t)-1; + } } return len; -- 2.50.0