mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-23 16:11:40 +02:00
CodeConversions: Make compatible with wx3.0
Signed-off-by: Mart Raudsepp <leio@gentoo.org>
This commit is contained in:
parent
786f21b85c
commit
f6b0cd343c
@ -28,7 +28,14 @@ std::string ToUTF8 (const wchar_t* wstr)
|
|||||||
|
|
||||||
std::string ToUTF8 (const wxString& wstr)
|
std::string ToUTF8 (const wxString& wstr)
|
||||||
{
|
{
|
||||||
|
#if wxCHECK_VERSION(3, 1, 1)
|
||||||
return wstr.ToStdString (wxGet_wxConvUTF8 ());
|
return wstr.ToStdString (wxGet_wxConvUTF8 ());
|
||||||
|
#elif !wxUSE_UNICODE
|
||||||
|
return std::string (wstr.c_str (), wstr.length ());
|
||||||
|
#else
|
||||||
|
wxScopedCharBuffer buf (wstr.mb_str (wxGet_wxConvUTF8 ()));
|
||||||
|
return std::string (buf.data (), buf.length ());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring ToWString (const std::string& str)
|
std::wstring ToWString (const std::string& str)
|
||||||
@ -48,7 +55,11 @@ std::wstring ToWString (const wxString& str)
|
|||||||
|
|
||||||
wxString ToWXString (const std::string& str)
|
wxString ToWXString (const std::string& str)
|
||||||
{
|
{
|
||||||
|
#if wxCHECK_VERSION(3, 1, 1)
|
||||||
return wxString::FromUTF8 (str);
|
return wxString::FromUTF8 (str);
|
||||||
|
#else
|
||||||
|
return wxString::FromUTF8 (str.c_str());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString ToWXString (const std::wstring& str)
|
wxString ToWXString (const std::wstring& str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user