X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5a1953b341d16396763bee067ccdd96108f3aad..b7e5ba8f2d676583c790c59388eba8bfa9bd33c2:/include/wx/strconv.h diff --git a/include/wx/strconv.h b/include/wx/strconv.h index 9e4794f3cb..d9e89d5e3c 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -12,10 +12,6 @@ #ifndef _WX_WXSTRCONVH__ #define _WX_WXSTRCONVH__ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "strconv.h" -#endif - #include "wx/defs.h" #include "wx/wxchar.h" #include "wx/buffer.h" @@ -86,6 +82,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) // ---------------------------------------------------------------------------- @@ -104,8 +125,18 @@ public: class WXDLLIMPEXP_BASE wxMBConvUTF8 : public wxMBConv { public: + enum { + MAP_INVALID_UTF8_NOT = 0, + MAP_INVALID_UTF8_TO_PUA = 1, + MAP_INVALID_UTF8_TO_OCTAL = 2 + }; + + wxMBConvUTF8(int options = MAP_INVALID_UTF8_NOT) : m_options(options) { } 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: + int m_options; }; // ---------------------------------------------------------------------------- @@ -131,7 +162,7 @@ public: }; // ---------------------------------------------------------------------------- -// wxMBConvUCS4LE (for conversion using UTF32 Little Endian encoding) +// wxMBConvUTF32LE (for conversion using UTF32 Little Endian encoding) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF32LE : public wxMBConv @@ -142,7 +173,7 @@ public: }; // ---------------------------------------------------------------------------- -// wxMBConvUCS4BE (for conversion using UTF32 Big Endian encoding) +// wxMBConvUTF32BE (for conversion using UTF32 Big Endian encoding) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF32BE : public wxMBConv @@ -201,6 +232,7 @@ private: bool m_deferred; }; + // ---------------------------------------------------------------------------- // declare predefined conversion objects // ----------------------------------------------------------------------------