]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid conversion to wchar_t* when getting UTF-8 value in UTF-8 build
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 11 May 2007 20:05:37 +0000 (20:05 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 11 May 2007 20:05:37 +0000 (20:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/tarstrm.cpp

index ea0c0d14a8af3b8e5d1cb6e64d3e6c2dfbf76be1..400a4e39894108388ef98eaaf51e247c807e003f 100644 (file)
@@ -1362,11 +1362,16 @@ void wxTarOutputStream::SetExtendedHeader(const wxString& key,
                                           const wxString& value)
 {
     if (m_pax) {
+#if wxUSE_UNICODE
+        const wxCharBuffer utf_key = key.utf8_str();
+        const wxCharBuffer utf_value = value.utf8_str();
+#else
         const wxWX2WCbuf wide_key = key.wc_str(GetConv());
         const wxCharBuffer utf_key = wxConvUTF8.cWC2MB(wide_key);
 
         const wxWX2WCbuf wide_value = value.wc_str(GetConv());
         const wxCharBuffer utf_value = wxConvUTF8.cWC2MB(wide_value);
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
 
         // a small buffer to format the length field in
         char buf[32];