Skip to content

Commit 35ddf0b

Browse files
author
Daniel Kroening
authored
Merge pull request #2533 from tautschnig/debian5
utf8 to utf16 conversion must use native endianness
2 parents 580f539 + c6c1938 commit 35ddf0b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

jbmc/src/java_bytecode/java_string_literals.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ symbol_exprt get_or_create_string_literal_symbol(
106106
if(string_refinement_enabled)
107107
{
108108
const array_exprt data =
109-
utf16_to_array(utf8_to_utf16_little_endian(id2string(value)));
109+
utf16_to_array(utf8_to_utf16(id2string(value), false));
110110

111111
struct_exprt literal_init(new_symbol.type);
112112
literal_init.operands().resize(jls_struct.components().size());

src/util/unicode.h

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ std::wstring widen(const std::string &s);
2424

2525
std::string utf32_to_utf8(const std::basic_string<unsigned int> &s);
2626

27+
std::wstring utf8_to_utf16(const std::string &in, bool swap_bytes);
2728
std::wstring utf8_to_utf16_big_endian(const std::string &);
2829
std::wstring utf8_to_utf16_little_endian(const std::string &);
2930
std::string utf16_little_endian_to_java(const wchar_t ch);

0 commit comments

Comments
 (0)