Skip to content

Commit

Permalink
Merge pull request diffblue#2533 from tautschnig/debian5
Browse files Browse the repository at this point in the history
utf8 to utf16 conversion must use native endianness
  • Loading branch information
Daniel Kroening authored Jul 7, 2018
2 parents 580f539 + c6c1938 commit 35ddf0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jbmc/src/java_bytecode/java_string_literals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ symbol_exprt get_or_create_string_literal_symbol(
if(string_refinement_enabled)
{
const array_exprt data =
utf16_to_array(utf8_to_utf16_little_endian(id2string(value)));
utf16_to_array(utf8_to_utf16(id2string(value), false));

struct_exprt literal_init(new_symbol.type);
literal_init.operands().resize(jls_struct.components().size());
Expand Down
1 change: 1 addition & 0 deletions src/util/unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ std::wstring widen(const std::string &s);

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

std::wstring utf8_to_utf16(const std::string &in, bool swap_bytes);
std::wstring utf8_to_utf16_big_endian(const std::string &);
std::wstring utf8_to_utf16_little_endian(const std::string &);
std::string utf16_little_endian_to_java(const wchar_t ch);
Expand Down

0 comments on commit 35ddf0b

Please sign in to comment.