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.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/testing/test_support.cpp b/testing/test_support.cpp
index 1ad8543bae..e5c3ab45a0 100644
--- a/testing/test_support.cpp
+++ b/testing/test_support.cpp
@@ -9,6 +9,7 @@
#include "core/fdrm/crypto/fx_crypt.h"
#include "core/fxcrt/fx_memory.h"
+#include "core/fxcrt/fx_string.h"
#include "testing/utils/path_service.h"
#ifdef PDF_ENABLE_V8
@@ -103,6 +104,13 @@ std::unique_ptr<char, pdfium::FreeDeleter> GetFileContents(const char* filename,
return buffer;
}
+std::string GetPlatformString(FPDF_WIDESTRING wstr) {
+ return std::string(
+ CFX_WideString::FromUTF16LE(wstr, CFX_WideString::WStringLength(wstr))
+ .UTF8Encode()
+ .c_str());
+}
+
std::wstring GetPlatformWString(FPDF_WIDESTRING wstr) {
if (!wstr)
return nullptr;