1 /* Charset handling while reading PO files.
2 Copyright (C) 2001-2003 Free Software Foundation, Inc.
3 Written by Bruno Haible <haible@clisp.cons.org>, 2001.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
34 /* Canonicalize an encoding name.
35 The results of this function are statically allocated and can be
37 extern const char *po_charset_canonicalize (const char *charset
);
39 /* The canonicalized encoding name for ASCII. */
40 extern DLL_VARIABLE
const char *po_charset_ascii
;
42 /* The canonicalized encoding name for UTF-8. */
43 extern DLL_VARIABLE
const char *po_charset_utf8
;
45 /* Test for ASCII compatibility. */
46 extern bool po_charset_ascii_compatible (const char *canon_charset
);
48 /* Test for a weird encoding, i.e. an encoding which has double-byte
49 characters ending in 0x5C. */
50 extern bool po_is_charset_weird (const char *canon_charset
);
52 /* Test for a weird CJK encoding, i.e. a weird encoding with CJK structure.
53 An encoding has CJK structure if every valid character stream is composed
54 of single bytes in the range 0x{00..7F} and of byte pairs in the range
55 0x{80..FF}{30..FF}. */
56 extern bool po_is_charset_weird_cjk (const char *canon_charset
);
59 /* The PO file's encoding, as specified in the header entry. */
60 extern DLL_VARIABLE
const char *po_lex_charset
;
63 /* Converter from the PO file's encoding to UTF-8. */
64 extern DLL_VARIABLE iconv_t po_lex_iconv
;
66 /* If no converter is available, some information about the structure of the
67 PO file's encoding. */
68 extern DLL_VARIABLE
bool po_lex_weird_cjk
;
70 /* Initialize the PO file's encoding. */
71 extern void po_lex_charset_init (void);
73 /* Set the PO file's encoding from the header entry. */
74 extern void po_lex_charset_set (const char *header_entry
,
75 const char *filename
);
77 /* Finish up with the PO file's encoding. */
78 extern void po_lex_charset_close (void);
86 #endif /* _PO_CHARSET_H */