summaryrefslogtreecommitdiff
path: root/testing/test_support.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'testing/test_support.cpp')
-rw-r--r--testing/test_support.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index e5c3ab45a0..0ebb7478c2 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -105,10 +105,9 @@ std::unique_ptr<char, pdfium::FreeDeleter> GetFileContents(const char* filename,
}
std::string GetPlatformString(FPDF_WIDESTRING wstr) {
- return std::string(
- CFX_WideString::FromUTF16LE(wstr, CFX_WideString::WStringLength(wstr))
- .UTF8Encode()
- .c_str());
+ CFX_WideString wide_string =
+ CFX_WideString::FromUTF16LE(wstr, CFX_WideString::WStringLength(wstr));
+ return std::string(wide_string.UTF8Encode().c_str());
}
std::wstring GetPlatformWString(FPDF_WIDESTRING wstr) {