git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56214
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxSTD ostream& operator<<(wxSTD ostream& os, const wxCStrData& str)
{
#if wxUSE_UNICODE && !wxUSE_UNICODE_UTF8
wxSTD ostream& operator<<(wxSTD ostream& os, const wxCStrData& str)
{
#if wxUSE_UNICODE && !wxUSE_UNICODE_UTF8
- return os << (const char *)str.AsCharBuf();
+ const wxCharBuffer buf(str.AsCharBuf());
+ if ( !buf )
+ os.clear(wxSTD ios_base::failbit);
+ else
+ os << buf.data();
+
+ return os;
#else
return os << str.AsInternal();
#endif
#else
return os << str.AsInternal();
#endif