return tst_convert_x(cd, buf, cmpbuf, 0);
}
-/* some test strings in ISO-8859-1 format */
-static const char *iso_8859_1_a[] = {
- "ax" ,
- "\xd8",
- "eneb\346r",
- "\xe5" "\xd8",
- "\xe5" "\xd8" "b",
- "\xe5" "\xe5",
- 0 };
-
static void tst_marc8_to_ucs4b(void)
{
yaz_iconv_t cd = yaz_iconv_open("UCS4", "MARC8");
static void dconvert(int mandatory, const char *tmpcode)
{
+ /* some test strings in ISO-8859-1 format */
+ static const char *iso_8859_1_a[] = {
+ "ax" ,
+ "\xd8",
+ "eneb\346r",
+ "\xe5" "\xd8",
+ "\xe5" "\xd8" "b",
+ "\xe5" "\xe5",
+ 0 };
int i;
int ret;
yaz_iconv_t cd;
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)
{
tst_utf8_to_marc8("marc8lossless");
tst_danmarc_to_latin1();
+ tst_utf8_to_danmarc();
tst_latin1_to_marc8();