Description: Do not enforce little-endian representation on big-endian archs
 .
 cbmc (5.9-6) unstable; urgency=low
 .
   * Fix mips 32-bit cross configuration
Author: Michael Tautschnig <mt@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2018-07-05

--- cbmc-5.9.orig/jbmc/src/java_bytecode/java_string_literals.cpp
+++ cbmc-5.9/jbmc/src/java_bytecode/java_string_literals.cpp
@@ -106,7 +106,7 @@ symbol_exprt get_or_create_string_litera
   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());
--- cbmc-5.9.orig/src/util/unicode.h
+++ cbmc-5.9/src/util/unicode.h
@@ -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);
