void check_analyze(std::string const& str, bool has8bit, bool utf8, bool utf16)
{
    bool has_8bit_chars = false;
    bool is_valid_utf8 = false;
    bool is_utf16 = false;
    QUtil::analyze_encoding(str, has_8bit_chars, is_valid_utf8, is_utf16);
    if (! ((has_8bit_chars == has8bit) &&
           (is_valid_utf8 == utf8) &&
           (is_utf16 == utf16)))
    {
        std::cout << "analysis failed: " << str << std::endl;
    }
}
void check_analyze(std::string const& str, bool has8bit, bool utf8, bool utf16)
{
    bool has_8bit_chars = false;
    bool is_valid_utf8 = false;
    bool is_utf16 = false;
    QUtil::analyze_encoding(str, has_8bit_chars, is_valid_utf8, is_utf16);
    if (! ((has_8bit_chars == has8bit) &&
           (is_valid_utf8 == utf8) &&
           (is_utf16 == utf16)))
    {
        std::cout << "analysis failed: " << str << std::endl;
    }
}