Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 143894 | Differences between
and this patch

Collapse All | Expand All

(-)mahogany-0.67.cvs/include/gui/wxMApp.h (+2 lines)
Lines 81-86 Link Here
81
   virtual bool CanClose() const;
81
   virtual bool CanClose() const;
82
   virtual void OnClose();
82
   virtual void OnClose();
83
83
84
   wxFontEncoding GetSystemEncoding_Workaround();
85
84
   // wxWin calls these functions to start/run/stop the application
86
   // wxWin calls these functions to start/run/stop the application
85
   virtual bool OnInit();
87
   virtual bool OnInit();
86
   virtual int  OnRun();
88
   virtual int  OnRun();
(-)mahogany-0.67.cvs/src/gui/wxMApp.cpp (-4 / +35 lines)
Lines 909-914 Link Here
909
#endif // 0
909
#endif // 0
910
}
910
}
911
911
912
wxFontEncoding wxMApp::GetSystemEncoding_Workaround()
913
{
914
    const wxString encname = wxLocale::GetSystemEncodingName();
915
    if ( !encname.empty() )
916
    {
917
        wxFontEncoding enc = wxFontMapperBase::GetEncodingFromName(encname);
918
919
        // on some modern Linux systems (RedHat 8) the default system locale
920
        // is UTF8 -- but it isn't supported by wxGTK1 in ANSI build at all so
921
        // don't even try to use it in this case
922
#if !wxUSE_UNICODE && \
923
        ((defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__WXMOTIF__))
924
        if ( enc == wxFONTENCODING_UTF8 )
925
        {
926
            // the most similar supported encoding...
927
            enc = wxFONTENCODING_ISO8859_1;
928
        }
929
#endif // !wxUSE_UNICODE
930
931
        // GetEncodingFromName() returns wxFONTENCODING_DEFAULT for C locale
932
        // (a.k.a. US-ASCII) which is arguably a bug but keep it like this for
933
        // backwards compatibility and just take care to not return
934
        // wxFONTENCODING_DEFAULT from here as this surely doesn't make sense
935
        if ( enc != wxFONTENCODING_MAX && enc != wxFONTENCODING_DEFAULT )
936
        {
937
            return enc;
938
        }
939
        //else: return wxFONTENCODING_SYSTEM below
940
    }
941
942
    return wxFONTENCODING_SYSTEM;
943
}
944
912
// app initilization
945
// app initilization
913
bool
946
bool
914
wxMApp::OnInit()
947
wxMApp::OnInit()
Lines 1102-1113 Link Here
1102
   }
1135
   }
1103
#endif // USE_I18N
1136
#endif // USE_I18N
1104
1137
1105
   // wxLocale::GetSystemEncoding() is broken in wx <= 2.6.3, it returns
1138
#ifdef __WXGTK20__
1106
   // ISO-8859-1 for UTF-8 locale
1107
#if defined(__WXGTK20__) && wxCHECK_VERSION(2, 6, 4)
1108
   // we need UTF-8 support to be able to work with messages in different
1139
   // we need UTF-8 support to be able to work with messages in different
1109
   // encodings
1140
   // encodings
1110
   if ( wxLocale::GetSystemEncoding() != wxFONTENCODING_UTF8 )
1141
   if ( GetSystemEncoding_Workaround() != wxFONTENCODING_UTF8 )
1111
   {
1142
   {
1112
      // TODO: set encoding to UTF-8 (but keeping the current language)
1143
      // TODO: set encoding to UTF-8 (but keeping the current language)
1113
      //       ourselves
1144
      //       ourselves

Return to bug 143894