diff --git a/src/common/unaccent.cpp b/src/common/unaccent.cpp index b025ef361..516f8abcd 100644 --- a/src/common/unaccent.cpp +++ b/src/common/unaccent.cpp @@ -66,3 +66,15 @@ std::string &removeAccents(std::string &text) { unicodeAccentedString.toUTF8String(text); return text; } + +void printStringInHexadecimal(const char *s) { + std::cout << std::showbase << std::hex; + for (char const* pc = s; *pc; ++pc) { + if (*pc & 0x80) + std::cout << (*pc & 0xff); + else + std::cout << *pc; + std::cout << ' '; + } + std::cout << std::endl; +} diff --git a/src/common/unaccent.h b/src/common/unaccent.h index 7c20ac36a..66d9188ee 100644 --- a/src/common/unaccent.h +++ b/src/common/unaccent.h @@ -95,3 +95,4 @@ private: }; std::string &removeAccents(std::string &text); +void printStringInHexadecimal(const char *s);