void transcoding_test(std::string (*to_utf8)(std::string const&),
                      std::string (*from_utf8)(std::string const&, char),
                      int last, std::string unknown)
{
    std::string in(" ");
    std::string out;
    std::string back;
    for (int i = 128; i <= last; ++i)
    {
        in.at(0) = static_cast<char>(static_cast<unsigned char>(i));
        out = (*to_utf8)(in);
        std::string wanted = (out == "\xef\xbf\xbd") ? unknown : in;
        back = (*from_utf8)(out, '?');
        if (back != wanted)
        {
            std::cout << i << ": " << in << " -> " << out
                      << " -> " << back << " (wanted " << wanted << ")"
                      << std::endl;
        }
    }
}
void transcoding_test(std::string (*to_utf8)(std::string const&),
                      std::string (*from_utf8)(std::string const&, char),
                      int last, std::string unknown)
{
    std::string in(" ");
    std::string out;
    std::string back;
    for (int i = 128; i <= last; ++i)
    {
        in.at(0) = static_cast<char>(static_cast<unsigned char>(i));
        out = (*to_utf8)(in);
        std::string wanted = (out == "\xef\xbf\xbd") ? unknown : in;
        back = (*from_utf8)(out, '?');
        if (back != wanted)
        {
            std::cout << i << ": " << in << " -> " << out
                      << " -> " << back << " (wanted " << wanted << ")"
                      << std::endl;
        }
    }
}