summaryrefslogtreecommitdiff
path: root/pith/charset.h
diff options
context:
space:
mode:
authorEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
committerEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
commit094ca96844842928810f14844413109fc6cdd890 (patch)
treee60efbb980f38ba9308ccb4fb2b77b87bbc115f3 /pith/charset.h
downloadalpine-094ca96844842928810f14844413109fc6cdd890.tar.xz
Initial Alpine Version
Diffstat (limited to 'pith/charset.h')
-rw-r--r--pith/charset.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/pith/charset.h b/pith/charset.h
new file mode 100644
index 00000000..f89c6e4c
--- /dev/null
+++ b/pith/charset.h
@@ -0,0 +1,56 @@
+/*
+ * $Id: charset.h 765 2007-10-23 23:51:37Z hubert@u.washington.edu $
+ *
+ * ========================================================================
+ * Copyright 2006 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+#ifndef PITH_CHARSET_INCLUDED
+#define PITH_CHARSET_INCLUDED
+
+
+#include "../pith/filttype.h"
+
+
+typedef struct conversion_table {
+ char *from_charset;
+ char *to_charset;
+ int quality;
+ void *table;
+ filter_t convert;
+} CONV_TABLE;
+
+
+/* Conversion table quality of tranlation */
+#define CV_NO_TRANSLATE_POSSIBLE 1 /* We don't know how to */
+ /* translate this pair */
+#define CV_NO_TRANSLATE_NEEDED 2 /* Not necessary, no-op */
+#define CV_LOSES_SPECIAL_CHARS 3 /* Letters will translate */
+ /* ok but some special chars */
+ /* may be lost */
+#define CV_LOSES_SOME_LETTERS 4 /* Some special chars and */
+ /* some letters may be lost */
+
+
+#define CSET_MAX 64
+
+
+/* exported protoypes */
+char *body_charset(MAILSTREAM *, long, unsigned char *);
+unsigned char *trans_euc_to_2022_jp(unsigned char *);
+unsigned char *rfc1522_decode_to_utf8(unsigned char *, size_t, char *);
+char *rfc1522_encode(char *, size_t, unsigned char *, char *);
+CONV_TABLE *conversion_table(char *, char *);
+void decode_addr_names_to_utf8(ADDRESS *);
+void convert_possibly_encoded_str_to_utf8(char **);
+
+
+#endif /* PITH_CHARSET_INCLUDED */