From fc6f3208b227fd7ebd7a1bcbb5f7bf22fb6506bb Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 3 Nov 2002 15:48:13 +0000 Subject: [PATCH] Some more Unicode fixes. What does wxTextStream do with a char in Unicode mode? git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/txtstrm.cpp | 8 ++------ src/common/url.cpp | 2 +- src/common/utilscmn.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 940f02c086..62f2e5f72c 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -493,12 +493,8 @@ wxTextOutputStream& wxTextOutputStream::operator<<(const wxString& string) wxTextOutputStream& wxTextOutputStream::operator<<(char c) { - // these strange manipulations are needed in Unicode mode - char buf[2]; - buf[0] = c; - buf[1] = 0; - - WriteString( wxString(buf) ); + WriteString( wxString::FromAscii(c) ); + return *this; } diff --git a/src/common/url.cpp b/src/common/url.cpp index 8ae14ec4e9..16e2689e9a 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -65,7 +65,7 @@ wxURL::wxURL(const wxString& url) #if wxUSE_SOCKETS if ( ms_useDefaultProxy && !ms_proxyDefault ) { - SetDefaultProxy(getenv("HTTP_PROXY")); + SetDefaultProxy( wxGetenv(wxT("HTTP_PROXY")) ); if ( !ms_proxyDefault ) { diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 0cdde609c2..3dcafe6cdb 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -281,10 +281,10 @@ StringMatch (const wxChar *str1, const wxChar *str2, bool subString, bool exact) // [volatile] wxString wxNow() { - time_t now = time((time_t *) NULL); - char *date = ctime(&now); - date[24] = '\0'; - return wxString(date); + time_t now = time((time_t *) NULL); + char *date = ctime(&now); + date[24] = '\0'; + return wxString::FromAscii(date); } #if wxUSE_GUI