X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_iconv.c;h=e3419722c8f933b34049340dcd8ef9065642c4c7;hp=4651203273ede9b094e6be30760cb9bada1daf53;hb=e462d48003aafc70536f9982b44edef5d32a5f6a;hpb=2edad3fa067b30e1a8effde531a5fe75ddd899ce diff --git a/test/test_iconv.c b/test/test_iconv.c index 4651203..e341972 100644 --- a/test/test_iconv.c +++ b/test/test_iconv.c @@ -701,6 +701,23 @@ static void tst_danmarc_to_latin1(void) yaz_iconv_close(cd); } +static void tst_utf8_to_danmarc(void) +{ + yaz_iconv_t cd = yaz_iconv_open("danmarc", "utf-8"); + + YAZ_CHECK(cd); + if (!cd) + return; + + YAZ_CHECK(tst_convert(cd, "ax", "ax")); + YAZ_CHECK(tst_convert(cd, "@", "@@")); + YAZ_CHECK(tst_convert(cd, "a\xc3\xa5" "b", "a\xe5" "b")); /* aring */ + YAZ_CHECK(tst_convert(cd, "a\xce\xbb" "b", "a@03BBb")); /* lambda */ + + yaz_iconv_close(cd); +} + + int main (int argc, char **argv) { @@ -722,6 +739,7 @@ int main (int argc, char **argv) tst_utf8_to_marc8("marc8lossless"); tst_danmarc_to_latin1(); + tst_utf8_to_danmarc(); tst_latin1_to_marc8();