Merge branch 'ical'
[alpine.git] / pith / charset.h
blobe51e70c0fbc4d30c89199d5f658197011dacd9df
1 /*
2 * $Id: charset.h 765 2007-10-23 23:51:37Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2017 Eduardo Chappa
6 * Copyright 2006 University of Washington
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * ========================================================================
17 #ifndef PITH_CHARSET_INCLUDED
18 #define PITH_CHARSET_INCLUDED
21 #include "../pith/filttype.h"
24 typedef struct conversion_table {
25 char *from_charset;
26 char *to_charset;
27 int quality;
28 void *table;
29 filter_t convert;
30 } CONV_TABLE;
33 /* Conversion table quality of tranlation */
34 #define CV_NO_TRANSLATE_POSSIBLE 1 /* We don't know how to */
35 /* translate this pair */
36 #define CV_NO_TRANSLATE_NEEDED 2 /* Not necessary, no-op */
37 #define CV_LOSES_SPECIAL_CHARS 3 /* Letters will translate */
38 /* ok but some special chars */
39 /* may be lost */
40 #define CV_LOSES_SOME_LETTERS 4 /* Some special chars and */
41 /* some letters may be lost */
44 #define CSET_MAX 64
47 /* exported protoypes */
48 char *body_charset(MAILSTREAM *, long, unsigned char *);
49 unsigned char *trans_euc_to_2022_jp(unsigned char *);
50 unsigned char *rfc1522_decode_to_utf8(unsigned char *, size_t, char *);
51 char *rfc1522_encode(char *, size_t, unsigned char *, char *);
52 CONV_TABLE *conversion_table(char *, char *);
53 void decode_addr_names_to_utf8(ADDRESS *);
54 void convert_possibly_encoded_str_to_utf8(char **);
57 #endif /* PITH_CHARSET_INCLUDED */