Don't lose Unicode data in wxMessageOutputStderr
Ensure that we do output the string contents even if we have to encode it in UTF-8 instead of the current locale encoding -- this is still better than not outputting anything at all. Closes #17358.
This commit is contained in:
parent
3bb98963fa
commit
fa8a482593
1 changed files with 1 additions and 6 deletions
|
|
@ -148,13 +148,8 @@ wxString wxMessageOutputStderr::AppendLineFeedIfNeeded(const wxString& str)
|
|||
void wxMessageOutputStderr::Output(const wxString& str)
|
||||
{
|
||||
const wxString strWithLF = AppendLineFeedIfNeeded(str);
|
||||
const wxWX2MBbuf buf = strWithLF.mb_str();
|
||||
|
||||
if ( buf )
|
||||
fprintf(m_fp, "%s", (const char*) buf);
|
||||
else // print at least something
|
||||
fprintf(m_fp, "%s", (const char*) strWithLF.ToAscii());
|
||||
|
||||
fprintf(m_fp, "%s", (const char*) strWithLF.mb_str(wxConvWhateverWorks));
|
||||
fflush(m_fp);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue