avoid conversion to wchar_t* when getting UTF-8 value in UTF-8 build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1362,11 +1362,16 @@ void wxTarOutputStream::SetExtendedHeader(const wxString& key,
|
|||||||
const wxString& value)
|
const wxString& value)
|
||||||
{
|
{
|
||||||
if (m_pax) {
|
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 wxWX2WCbuf wide_key = key.wc_str(GetConv());
|
||||||
const wxCharBuffer utf_key = wxConvUTF8.cWC2MB(wide_key);
|
const wxCharBuffer utf_key = wxConvUTF8.cWC2MB(wide_key);
|
||||||
|
|
||||||
const wxWX2WCbuf wide_value = value.wc_str(GetConv());
|
const wxWX2WCbuf wide_value = value.wc_str(GetConv());
|
||||||
const wxCharBuffer utf_value = wxConvUTF8.cWC2MB(wide_value);
|
const wxCharBuffer utf_value = wxConvUTF8.cWC2MB(wide_value);
|
||||||
|
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
|
||||||
|
|
||||||
// a small buffer to format the length field in
|
// a small buffer to format the length field in
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
Reference in New Issue
Block a user