summaryrefslogtreecommitdiffstats
path: root/unicode/unicodetest.c
diff options
context:
space:
mode:
authorSam Varshavchik2018-07-15 20:15:35 -0400
committerSam Varshavchik2018-07-15 20:15:35 -0400
commit3fe758e75eca989576a6a8f58a9b4068452db02e (patch)
treec32814acd5563b295f7e6eed630a8846e80f6f47 /unicode/unicodetest.c
parent83b8a17c2dbb0feccc7c1c02d7d170ef84880126 (diff)
downloadcourier-libs-3fe758e75eca989576a6a8f58a9b4068452db02e.tar.bz2
courier-unicode: fix error and validation of modified-UTF7 encoding.
Diffstat (limited to 'unicode/unicodetest.c')
-rw-r--r--unicode/unicodetest.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/unicode/unicodetest.c b/unicode/unicodetest.c
index b309ad6..e9e4228 100644
--- a/unicode/unicodetest.c
+++ b/unicode/unicodetest.c
@@ -140,6 +140,28 @@ int main(int argc, char **argv)
++argn;
}
+ if (argn < argc && strcmp(argv[argn], "--modutf7toutf8") == 0)
+ {
+ while (++argn < argc)
+ {
+ int error=0;
+ char *p=unicode_convert_tobuf(argv[argn],
+ unicode_x_imap_modutf7,
+ unicode_x_smap_modutf8,
+ &error);
+
+ if (p)
+ {
+ printf("%s\n", p);
+ free(p);
+ }
+ else
+ {
+ printf("[error]\n");
+ }
+ }
+ }
+
if (argn < argc && strcmp(argv[argn], "--totitle") == 0)
{
++argn;