diff --git a/include/wx/strconv.h b/include/wx/strconv.h index 9aa87f8014..470632ca4a 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -687,12 +687,15 @@ extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvUI; // function which would crash if we passed NULL to it), so these functions // always return a valid pointer if their argument is non-NULL - // this function safety is achieved by trying wxConvLibc first, wxConvUTF8 - // next if it fails and, finally, wxConvISO8859_1 which always succeeds - extern WXDLLIMPEXP_BASE wxWCharBuffer wxSafeConvertMB2WX(const char *s); + inline wxWCharBuffer wxSafeConvertMB2WX(const char *s) + { + return wxConvWhateverWorks.cMB2WC(s); + } - // this function uses wxConvLibc and wxConvUTF8 if it fails - extern WXDLLIMPEXP_BASE wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws); + inline wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws) + { + return wxConvWhateverWorks.cWC2MB(ws); + } #else // ANSI // no conversions to do #define wxConvertWX2MB(s) (s) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 2756870d55..0390dc3795 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -3320,36 +3320,6 @@ wxWhateverWorksConv::FromWChar(char *dst, size_t dstLen, return rc; } -#if wxUSE_UNICODE - -wxWCharBuffer wxSafeConvertMB2WX(const char *s) -{ - if ( !s ) - return wxWCharBuffer(); - - wxWCharBuffer wbuf(wxConvLibc.cMB2WX(s)); - if ( !wbuf ) - wbuf = wxConvUTF8.cMB2WX(s); - if ( !wbuf ) - wbuf = wxConvISO8859_1.cMB2WX(s); - - return wbuf; -} - -wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws) -{ - if ( !ws ) - return wxCharBuffer(); - - wxCharBuffer buf(wxConvLibc.cWX2MB(ws)); - if ( !buf ) - buf = wxConvUTF8.cWX2MB(ws); - - return buf; -} - -#endif // wxUSE_UNICODE - // ---------------------------------------------------------------------------- // globals // ----------------------------------------------------------------------------