Merge pull request #1133 from techee/readme_rst
[geany-mirror.git] / src / encodings.h
blob093483124e8e4692fab20e89b5c0be8443c3ccc1
1 /*
2 * encodings.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 /**
24 * @file encodings.h
25 * Encoding conversion and Byte Order Mark (BOM) handling.
26 **/
29 * Modified by the gedit Team, 2002. See the gedit AUTHORS file for a
30 * list of people on the gedit Team.
31 * See the gedit ChangeLog files for a list of changes.
34 /* Stolen from anjuta */
36 #ifndef GEANY_ENCODINGS_H
37 #define GEANY_ENCODINGS_H 1
39 #include "gtkcompat.h"
41 G_BEGIN_DECLS
44 * The original versions of the following tables are taken from profterm
46 * Copyright (C) 2002 Red Hat, Inc.
49 /** List of known and supported encodings. */
50 typedef enum
52 GEANY_ENCODING_ISO_8859_1,
53 GEANY_ENCODING_ISO_8859_2,
54 GEANY_ENCODING_ISO_8859_3,
55 GEANY_ENCODING_ISO_8859_4,
56 GEANY_ENCODING_ISO_8859_5,
57 GEANY_ENCODING_ISO_8859_6,
58 GEANY_ENCODING_ISO_8859_7,
59 GEANY_ENCODING_ISO_8859_8,
60 GEANY_ENCODING_ISO_8859_8_I,
61 GEANY_ENCODING_ISO_8859_9,
62 GEANY_ENCODING_ISO_8859_10,
63 GEANY_ENCODING_ISO_8859_13,
64 GEANY_ENCODING_ISO_8859_14,
65 GEANY_ENCODING_ISO_8859_15,
66 GEANY_ENCODING_ISO_8859_16,
68 GEANY_ENCODING_UTF_7,
69 GEANY_ENCODING_UTF_8,
70 GEANY_ENCODING_UTF_16LE,
71 GEANY_ENCODING_UTF_16BE,
72 GEANY_ENCODING_UCS_2LE,
73 GEANY_ENCODING_UCS_2BE,
74 GEANY_ENCODING_UTF_32LE,
75 GEANY_ENCODING_UTF_32BE,
77 GEANY_ENCODING_ARMSCII_8,
78 GEANY_ENCODING_BIG5,
79 GEANY_ENCODING_BIG5_HKSCS,
80 GEANY_ENCODING_CP_866,
82 GEANY_ENCODING_EUC_JP,
83 GEANY_ENCODING_EUC_KR,
84 GEANY_ENCODING_EUC_TW,
86 GEANY_ENCODING_GB18030,
87 GEANY_ENCODING_GB2312,
88 GEANY_ENCODING_GBK,
89 GEANY_ENCODING_GEOSTD8,
90 GEANY_ENCODING_HZ,
92 GEANY_ENCODING_IBM_850,
93 GEANY_ENCODING_IBM_852,
94 GEANY_ENCODING_IBM_855,
95 GEANY_ENCODING_IBM_857,
96 GEANY_ENCODING_IBM_862,
97 GEANY_ENCODING_IBM_864,
99 GEANY_ENCODING_ISO_2022_JP,
100 GEANY_ENCODING_ISO_2022_KR,
101 GEANY_ENCODING_ISO_IR_111,
102 GEANY_ENCODING_JOHAB,
103 GEANY_ENCODING_KOI8_R,
104 GEANY_ENCODING_KOI8_U,
106 GEANY_ENCODING_SHIFT_JIS,
107 GEANY_ENCODING_TCVN,
108 GEANY_ENCODING_TIS_620,
109 GEANY_ENCODING_UHC,
110 GEANY_ENCODING_VISCII,
112 GEANY_ENCODING_WINDOWS_1250,
113 GEANY_ENCODING_WINDOWS_1251,
114 GEANY_ENCODING_WINDOWS_1252,
115 GEANY_ENCODING_WINDOWS_1253,
116 GEANY_ENCODING_WINDOWS_1254,
117 GEANY_ENCODING_WINDOWS_1255,
118 GEANY_ENCODING_WINDOWS_1256,
119 GEANY_ENCODING_WINDOWS_1257,
120 GEANY_ENCODING_WINDOWS_1258,
122 GEANY_ENCODING_NONE,
123 GEANY_ENCODING_CP_932,
125 GEANY_ENCODINGS_MAX
127 GeanyEncodingIndex;
129 gchar *encodings_convert_to_utf8(const gchar *buffer, gssize size, gchar **used_encoding);
131 /* Converts a string from the given charset to UTF-8.
132 * If fast is set, no further checks are performed. */
133 gchar *encodings_convert_to_utf8_from_charset(const gchar *buffer, gssize size,
134 const gchar *charset, gboolean fast);
136 const gchar* encodings_get_charset_from_index(gint idx);
138 G_END_DECLS
140 #endif /* GEANY_ENCODINGS_H */