@ 261105.1

260930.1 · a2c7b2d81732a44eea04e5ed9335a2295dbbf716

https://gitlab.com/saalen/highlight/-/work_items/266 convert UTF-16 files to UTF-8 for processing

reading declarations

Changes to src/include/stringtools.h. All files

src/include/stringtools.h

@@ -87,6 +87,14 @@ bool endsWith(std::string const & value, std::string const & ending);  int utf8_strlen(const std::string& str); +/** Convert UTF-16 or UTF-32 encoded bytes (without BOM) to UTF-8.+    Invalid code units are replaced by U+FFFD.+    \param bytes input bytes+    \param unitSize 2 for UTF-16, 4 for UTF-32+    \param bigEndian true if code units are big endian+    \return UTF-8 string */+std::string utfWideToUtf8(const std::string& bytes, unsigned int unitSize, bool bigEndian);+ std::string sanitizeForTerminal(std::string_view s); }