Remove code for unsupported wxUSE_UNICODE==0 build

Leave only wxUSE_UNICODE branch and simplify UTF-8 conversions.
This commit is contained in:
Vadim Zeitlin
2026-08-06 21:59:34 +02:00
parent 8b70724c6a
commit c0b25d7e86
+2 -16
View File
@@ -576,23 +576,14 @@ bool wxIPCMessageBase::ReadString(wxString& str)
if ( len > 0 )
{
#if wxUSE_UNICODE
wxCharBuffer buf(len);
if ( !buf || !ReadData(buf.data(), len) )
return false;
#else
wxStringBuffer buf(str, len);
if ( !buf || !ReadData(buf,len) )
return false;
#endif
if ( !VerifyLastReadCount(len))
return false;
#if wxUSE_UNICODE
str = wxConvUTF8.cMB2WC(buf.data(), len, nullptr);
#endif
str = wxString::FromUTF8(buf.data(), len);
}
return true;
@@ -600,13 +591,8 @@ bool wxIPCMessageBase::ReadString(wxString& str)
bool wxIPCMessageBase::WriteString(const wxString& str)
{
#if wxUSE_UNICODE
const wxWX2MBbuf buf = str.mb_str(wxConvUTF8);
const wxScopedCharBuffer& buf = str.utf8_str();
size_t len = buf.length();
#else
const wxWX2MBbuf buf = str.mb_str();
size_t len = str.size();
#endif
if (len > 0)
return Write32(len) && WriteData(buf, len);