From fbf9b66e03cd894ca0fc654247fd6a4f9029db30 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 13 Oct 2002 14:00:03 +0000 Subject: [PATCH] Shouldn't the fontmapper recognize 8859 as iso-8859? git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17513 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/fontmap.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 65f109691c..2abd4daa72 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -557,6 +557,27 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset, } } } + else if ( cs.Left(4) == wxT("8859") ) + { + const wxChar *p = cs.c_str(); + + unsigned int value; + if ( wxSscanf(p, wxT("8859-%u"), &value) == 1 ) + { + // printf( "value %d\n", (int)value ); + + // make it 0 based and check that it is strictly positive in + // the process (no such thing as iso8859-0 encoding) + if ( (value-- > 0) && + (value < wxFONTENCODING_ISO8859_MAX - + wxFONTENCODING_ISO8859_1) ) + { + // it's a valid ISO8859 encoding + value += wxFONTENCODING_ISO8859_1; + encoding = (wxFontEncoding)value; + } + } + } else // check for Windows charsets { size_t len;