diff options
Diffstat (limited to 'core/fxcrt/bytestring.cpp')
-rw-r--r-- | core/fxcrt/bytestring.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp index 4d55c98912..b6c1ce7bbd 100644 --- a/core/fxcrt/bytestring.cpp +++ b/core/fxcrt/bytestring.cpp @@ -676,26 +676,6 @@ WideString ByteString::UTF8Decode() const { return WideString(decoder.GetResult()); } -// static -ByteString ByteString::FromUnicode(const WideString& wstr) { - int src_len = wstr.GetLength(); - int dest_len = - FXSYS_WideCharToMultiByte(FX_CODEPAGE_DefANSI, 0, wstr.c_str(), src_len, - nullptr, 0, nullptr, nullptr); - if (!dest_len) - return ByteString(); - - ByteString bstr; - { - // Span's lifetime must end before ReleaseBuffer() below. - pdfium::span<char> dest_buf = bstr.GetBuffer(dest_len); - FXSYS_WideCharToMultiByte(FX_CODEPAGE_DefANSI, 0, wstr.c_str(), src_len, - dest_buf.data(), dest_len, nullptr, nullptr); - } - bstr.ReleaseBuffer(dest_len); - return bstr; -} - int ByteString::Compare(const ByteStringView& str) const { if (!m_pData) return str.IsEmpty() ? 0 : -1; |