9 #ifndef CPROVER_UTIL_UNICODE_H
10 #define CPROVER_UTIL_UNICODE_H
19 std::string
narrow(
const wchar_t *s);
20 std::wstring
widen(
const char *s);
21 std::string
narrow(
const std::wstring &s);
22 std::wstring
widen(
const std::string &s);
26 # define widen_if_needed(s) widen(s)
28 # define widen_if_needed(s) (s)
43 std::vector<std::string>
narrow_argv(
int argc,
const wchar_t **argv_wide);
65 template <
typename It>
69 std::vector<const char *> ret(std::distance(b, e) + 1,
nullptr);
71 b, e, std::begin(ret), [](
const std::string &s) {
return s.c_str(); });
static abstract_object_pointert transform(const exprt &expr, const std::vector< abstract_object_pointert > &operands, const abstract_environmentt &environment, const namespacet &ns)
std::vector< std::string > narrow_argv(int argc, const wchar_t **argv_wide)
std::string narrow(const wchar_t *s)
std::string utf32_native_endian_to_utf8(const std::basic_string< unsigned int > &s)
std::u32string utf8_to_utf32(const std::string &utf8_str)
Convert UTF8-encoded string to UTF-32 with architecture-native endianness.
std::wstring widen(const char *s)
char16_t codepoint_hex_to_utf16_native_endian(const std::string &hex)
std::string utf16_native_endian_to_utf8(char16_t utf16_char)
std::string codepoint_hex_to_utf8(const std::string &hex)
std::string utf16_native_endian_to_java_string(const std::wstring &in)
Escapes non-printable characters, whitespace except for spaces, double quotes and backslashes.
std::vector< const char * > to_c_str_array(It b, It e)
std::string utf16_native_endian_to_java(const char16_t ch)
std::wstring utf8_to_utf16_native_endian(const std::string &in)
Convert UTF8-encoded string to UTF-16 with architecture-native endianness.