From 87bdd6fe226333eb715c5a4c5c0b431d15260d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano-Tarumi?= Date: Sat, 12 Jan 2019 15:46:04 -0500 Subject: [PATCH] t: cannot rely on iconv's //TRANSLIT It's really system-dependant. As long as it doesn't break the regular conversion it's fine. Managing transliteration is a nice to have but we cannot expect it would work everywhere. On systems that don't support it, iconv will trigger an EILSEQ. --- t/system.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/t/system.cc b/t/system.cc index 2e8fc68..4624a9d 100644 --- a/t/system.cc +++ b/t/system.cc @@ -33,8 +33,8 @@ void check_partial_files() void check_converter() { const char* ephemere_iso = "\xc9\x70\x68\xe9\x6d\xe8\x72\x65"; - ot::encoding_converter to_utf8("ISO-8859-1", "UTF-8"); - ot::encoding_converter from_utf8("UTF-8", "ISO-8859-1//TRANSLIT"); + ot::encoding_converter to_utf8("ISO_8859-1", "UTF-8"); + ot::encoding_converter from_utf8("UTF-8", "ISO_8859-1//TRANSLIT"); std::string out; ot::status rc = to_utf8(ephemere_iso, out); @@ -47,10 +47,6 @@ void check_converter() rc = from_utf8("\xFF\xFF", out); is(rc, ot::st::badly_encoded, "conversion from bad UTF-8 fails"); - - rc = from_utf8("cat 猫 chat", out); - is(rc, ot::st::information_lost, "lossy conversion from UTF-8 is detected"); - is(out, "cat ? chat", "check result of lossy conversion"); } int main(int argc, char **argv)