X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d51305e81eb593bedd92cda864671e15209c268f..32485259c1342115488d219776dfebeb3d4d81b1:/include/wx/strconv.h diff --git a/include/wx/strconv.h b/include/wx/strconv.h index ce0f040121..6919583e8d 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -86,6 +86,31 @@ public: virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const; }; +#ifdef __UNIX__ + +// ---------------------------------------------------------------------------- +// wxConvBrokenFileNames is made for Unix in Unicode mode when +// files are accidentally written in an encoding which is not +// the system encoding. Typically, the system encoding will be +// UTF8 but there might be files stored in ISO8859-1 on disk. +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_BASE wxConvBrokenFileNames : public wxMBConv +{ +public: + wxConvBrokenFileNames(const wxChar *charset); + virtual ~wxConvBrokenFileNames() { delete m_conv; } + + virtual size_t MB2WC(wchar_t *outputBuf, const char *psz, size_t outputSize) const; + virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const; + +private: + // the conversion object we forward to + wxMBConv *m_conv; +}; + +#endif + // ---------------------------------------------------------------------------- // wxMBConvUTF7 (for conversion using UTF7 encoding) // ---------------------------------------------------------------------------- @@ -211,30 +236,6 @@ private: bool m_deferred; }; -#ifdef __UNIX__ - -// ---------------------------------------------------------------------------- -// wxConvBrokenFileNames is made for GTK2 in Unicode mode when -// files are accidentally written in an encoding which is not -// the system encoding. Typically, the system encoding will be -// UTF8 but there might be files stored in ISO8859-1 on disk. -// ---------------------------------------------------------------------------- - -class wxConvBrokenFileNames : public wxMBConv -{ -public: - wxConvBrokenFileNames(); - virtual ~wxConvBrokenFileNames() { delete m_conv; } - - virtual size_t MB2WC(wchar_t *outputBuf, const char *psz, size_t outputSize) const; - virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const; - -private: - // the conversion object we forward to - wxMBConv *m_conv; -}; -#endif -// __UNIX__ // ---------------------------------------------------------------------------- // declare predefined conversion objects