Allow specifying the replacement character in wxString::ToAscii()

Don't hardcode "_" as the replacement character but accept the one specified
by the user.

Closes https://github.com/wxWidgets/wxWidgets/pull/116
This commit is contained in:
Stefano D. Mtangoo
2016-01-02 17:32:22 +01:00
committed by Vadim Zeitlin
parent cfd4da8fdb
commit 28bc1bdac0
4 changed files with 13 additions and 8 deletions

View File

@@ -1556,13 +1556,13 @@ public:
static wxString FromAscii(const char *ascii, size_t len);
static wxString FromAscii(const char *ascii);
static wxString FromAscii(char ascii);
const wxScopedCharBuffer ToAscii() const;
const wxScopedCharBuffer ToAscii(char replaceWith = '_') const;
#else // ANSI
static wxString FromAscii(const char *ascii) { return wxString( ascii ); }
static wxString FromAscii(const char *ascii, size_t len)
{ return wxString( ascii, len ); }
static wxString FromAscii(char ascii) { return wxString( ascii ); }
const char *ToAscii() const { return c_str(); }
const char *ToAscii(char WXUNUSED(replaceWith) = '_') const { return c_str(); }
#endif // Unicode/!Unicode
// also provide unsigned char overloads as signed/unsigned doesn't matter