From c2380e8f6ea896d3e3e37686c0c4445b1f218d4c Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Mon, 5 Nov 2018 16:00:09 +0000 Subject: [PATCH] Change utf16_native_endian_to_java to consume char16_t Java chars are fixed to be 16 bits by the standard. --- src/util/unicode.cpp | 2 +- src/util/unicode.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/unicode.cpp b/src/util/unicode.cpp index 6adcbcd67d..3799cb0465 100644 --- a/src/util/unicode.cpp +++ b/src/util/unicode.cpp @@ -295,7 +295,7 @@ static void utf16_native_endian_to_java( /// \param ch: UTF-16 character in architecture-native endianness encoding /// \return String in US-ASCII format, with \\uxxxx escapes for other characters -std::string utf16_native_endian_to_java(const wchar_t ch) +std::string utf16_native_endian_to_java(const char16_t ch) { std::ostringstream result; const std::locale loc; diff --git a/src/util/unicode.h b/src/util/unicode.h index dba750dea2..9a0cc116ec 100644 --- a/src/util/unicode.h +++ b/src/util/unicode.h @@ -26,7 +26,7 @@ std::string utf32_native_endian_to_utf8(const std::basic_string &s); std::wstring utf8_to_utf16_native_endian(const std::string &in); -std::string utf16_native_endian_to_java(const wchar_t ch); +std::string utf16_native_endian_to_java(const char16_t ch); std::string utf16_native_endian_to_java(const std::wstring &in); std::vector narrow_argv(int argc, const wchar_t **argv_wide);