From d24ffcf74941a257fc21b887bb325bac014c607c Mon Sep 17 00:00:00 2001 From: Gavin Kinsey Date: Tue, 11 Oct 2016 09:46:38 +0100 Subject: [PATCH] Fix wxHTML parse bug in non-unicode, ? characters are not displayed. GetEntitiesParser()->GetCharForCode(NBSP_UNICODE_VALUE) in the non-unicode build returns the value '?' as it doesn't find a match for that value. The parser then proceeds to replace all '?' characters in the HTML document with NBSP. Change the type of the #define to be unsigned int rather than wxChar for non-unicode to fix this. Closes #17692. --- src/html/winpars.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 83a06fc123..4187a54dfe 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -338,10 +338,11 @@ wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type, return GetFS()->OpenFile(myurl, flags); } -#define NBSP_UNICODE_VALUE (wxChar(160)) #if !wxUSE_UNICODE + #define NBSP_UNICODE_VALUE (160U) #define CUR_NBSP_VALUE m_nbsp #else + #define NBSP_UNICODE_VALUE (wxChar(160)) #define CUR_NBSP_VALUE NBSP_UNICODE_VALUE #endif