From c48ada3df455fffffe0d9f5ce1171b30ed949c19 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 22 Sep 2009 13:06:10 +0000 Subject: [PATCH] Fixed #9996 (incorrect XML output in Ansi build for non-ASCII character) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextxml.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index 2324e3b9f9..856f3f0750 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -482,7 +482,11 @@ static void OutputStringEnt(wxOutputStream& stream, const wxString& str, OutputString(stream, str.Mid(last, i - last), convMem, convFile); wxString s(wxT("&#")); +#if wxUSE_UNICODE s << (int) c; +#else + s << (int) wxUChar(c); +#endif s << wxT(";"); OutputString(stream, s, NULL, NULL); last = i + 1; @@ -534,7 +538,11 @@ static wxString AttributeToXML(const wxString& str) str1 += str.Mid(last, i - last); wxString s(wxT("&#")); +#if wxUSE_UNICODE s << (int) c; +#else + s << (int) wxUChar(c); +#endif s << wxT(";"); str1 += s; last = i + 1; @@ -716,7 +724,11 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem, } else for (i = 0; i < len; i++) { +#if wxUSE_UNICODE int c = (int) text[i]; +#else + int c = (int) wxUChar(text[i]); +#endif if ((c < 32 || c == 34) && c != 9 && c != 10 && c != 13) { if (i > 0)