summaryrefslogtreecommitdiff
path: root/tests/test-iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-iconv.c')
-rw-r--r--tests/test-iconv.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/test-iconv.c b/tests/test-iconv.c
index ed715bda..e58d460c 100644
--- a/tests/test-iconv.c
+++ b/tests/test-iconv.c
@@ -1,5 +1,5 @@
/* Test of character set conversion.
- Copyright (C) 2007-2015 Free Software Foundation, Inc.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,8 +44,14 @@ main ()
#if HAVE_ICONV
/* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
and UTF-8. */
- iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
- iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO8859-1");
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+
+#if defined __MVS__ && defined __IBMC__
+ /* String literals below are in ASCII, not EBCDIC. */
+# pragma convert("ISO8859-1")
+# define CONVERT_ENABLED
+#endif
ASSERT (cd_88591_to_utf8 != (iconv_t)(-1));
ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
@@ -142,7 +148,12 @@ main ()
iconv_close (cd_88591_to_utf8);
iconv_close (cd_utf8_to_88591);
+
+#ifdef CONVERT_ENABLED
+# pragma convert(pop)
#endif
+#endif /* HAVE_ICONV */
+
return 0;
}