annotate Plugins/Input/flac/charset.c @ 248:e557fce67f47 trunk

[svn] Avoid discarding pointer type qualifiers.
author chainsaw
date Sat, 03 Dec 2005 08:46:07 -0800
parents fa848bd484d8
children f12d7e208b43
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /* libxmms-flac - XMMS FLAC input plugin
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 * Copyright (C) 2002,2003,2004,2005 Daisuke Shimamura
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * Almost from charset.c
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 * EasyTAG - Tag editor for MP3 and OGG files
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 * Copyright (C) 1999-2001 Håvard Kvålen <havardk@xmms.org>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 * modify it under the terms of the GNU General Public License
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 * as published by the Free Software Foundation; either version 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 * of the License, or (at your option) any later version.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16 * GNU General Public License for more details.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23 #include <stdlib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 #include <glib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25 #include <string.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26 #include <errno.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 #include "plugin_common/charset.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 #include "plugin_common/locale_hack.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30 #include "charset.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31 #include "configure.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 /****************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 * Declarations *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36 ****************/
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 #define CHARSET_TRANS_ARRAY_LEN ( sizeof(charset_trans_array) / sizeof((charset_trans_array)[0]) )
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 const CharsetInfo charset_trans_array[] = {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 {N_("Arabic (IBM-864)"), "IBM864" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 {N_("Arabic (ISO-8859-6)"), "ISO-8859-6" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 {N_("Arabic (Windows-1256)"), "windows-1256" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
43 {N_("Baltic (ISO-8859-13)"), "ISO-8859-13" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44 {N_("Baltic (ISO-8859-4)"), "ISO-8859-4" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45 {N_("Baltic (Windows-1257)"), "windows-1257" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46 {N_("Celtic (ISO-8859-14)"), "ISO-8859-14" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47 {N_("Central European (IBM-852)"), "IBM852" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48 {N_("Central European (ISO-8859-2)"), "ISO-8859-2" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 {N_("Central European (Windows-1250)"), "windows-1250" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 {N_("Chinese Simplified (GB18030)"), "gb18030" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51 {N_("Chinese Simplified (GB2312)"), "GB2312" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 {N_("Chinese Traditional (Big5)"), "Big5" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53 {N_("Chinese Traditional (Big5-HKSCS)"), "Big5-HKSCS" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 {N_("Cyrillic (IBM-855)"), "IBM855" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 {N_("Cyrillic (ISO-8859-5)"), "ISO-8859-5" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56 {N_("Cyrillic (ISO-IR-111)"), "ISO-IR-111" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 {N_("Cyrillic (KOI8-R)"), "KOI8-R" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58 {N_("Cyrillic (Windows-1251)"), "windows-1251" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 {N_("Cyrillic/Russian (CP-866)"), "IBM866" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 {N_("Cyrillic/Ukrainian (KOI8-U)"), "KOI8-U" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61 {N_("English (US-ASCII)"), "us-ascii" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62 {N_("Greek (ISO-8859-7)"), "ISO-8859-7" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63 {N_("Greek (Windows-1253)"), "windows-1253" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 {N_("Hebrew (IBM-862)"), "IBM862" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65 {N_("Hebrew (Windows-1255)"), "windows-1255" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66 {N_("Japanese (EUC-JP)"), "EUC-JP" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
67 {N_("Japanese (ISO-2022-JP)"), "ISO-2022-JP" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68 {N_("Japanese (Shift_JIS)"), "Shift_JIS" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
69 {N_("Korean (EUC-KR)"), "EUC-KR" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70 {N_("Nordic (ISO-8859-10)"), "ISO-8859-10" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
71 {N_("South European (ISO-8859-3)"), "ISO-8859-3" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
72 {N_("Thai (TIS-620)"), "TIS-620" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
73 {N_("Turkish (IBM-857)"), "IBM857" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
74 {N_("Turkish (ISO-8859-9)"), "ISO-8859-9" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
75 {N_("Turkish (Windows-1254)"), "windows-1254" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
76 {N_("Unicode (UTF-7)"), "UTF-7" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77 {N_("Unicode (UTF-8)"), "UTF-8" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78 {N_("Unicode (UTF-16BE)"), "UTF-16BE" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
79 {N_("Unicode (UTF-16LE)"), "UTF-16LE" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
80 {N_("Unicode (UTF-32BE)"), "UTF-32BE" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
81 {N_("Unicode (UTF-32LE)"), "UTF-32LE" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
82 {N_("Vietnamese (VISCII)"), "VISCII" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
83 {N_("Vietnamese (Windows-1258)"), "windows-1258" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
84 {N_("Visual Hebrew (ISO-8859-8)"), "ISO-8859-8" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
85 {N_("Western (IBM-850)"), "IBM850" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
86 {N_("Western (ISO-8859-1)"), "ISO-8859-1" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
87 {N_("Western (ISO-8859-15)"), "ISO-8859-15" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
88 {N_("Western (Windows-1252)"), "windows-1252" }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
89
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
90 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
91 * From this point, character sets aren't supported by iconv
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
92 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
93 #if 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
94 {N_("Arabic (IBM-864-I)"), "IBM864i" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
95 {N_("Arabic (ISO-8859-6-E)"), "ISO-8859-6-E" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
96 {N_("Arabic (ISO-8859-6-I)"), "ISO-8859-6-I" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
97 {N_("Arabic (MacArabic)"), "x-mac-arabic" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
98 {N_("Armenian (ARMSCII-8)"), "armscii-8" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
99 {N_("Central European (MacCE)"), "x-mac-ce" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
100 {N_("Chinese Simplified (GBK)"), "x-gbk" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
101 {N_("Chinese Simplified (HZ)"), "HZ-GB-2312" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
102 {N_("Chinese Traditional (EUC-TW)"), "x-euc-tw" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
103 {N_("Croatian (MacCroatian)"), "x-mac-croatian" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
104 {N_("Cyrillic (MacCyrillic)"), "x-mac-cyrillic" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
105 {N_("Cyrillic/Ukrainian (MacUkrainian)"), "x-mac-ukrainian" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
106 {N_("Farsi (MacFarsi)"), "x-mac-farsi"},
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
107 {N_("Greek (MacGreek)"), "x-mac-greek" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
108 {N_("Gujarati (MacGujarati)"), "x-mac-gujarati" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
109 {N_("Gurmukhi (MacGurmukhi)"), "x-mac-gurmukhi" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
110 {N_("Hebrew (ISO-8859-8-E)"), "ISO-8859-8-E" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
111 {N_("Hebrew (ISO-8859-8-I)"), "ISO-8859-8-I" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
112 {N_("Hebrew (MacHebrew)"), "x-mac-hebrew" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
113 {N_("Hindi (MacDevanagari)"), "x-mac-devanagari" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
114 {N_("Icelandic (MacIcelandic)"), "x-mac-icelandic" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
115 {N_("Korean (JOHAB)"), "x-johab" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
116 {N_("Korean (UHC)"), "x-windows-949" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
117 {N_("Romanian (MacRomanian)"), "x-mac-romanian" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
118 {N_("Turkish (MacTurkish)"), "x-mac-turkish" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
119 {N_("User Defined"), "x-user-defined" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
120 {N_("Vietnamese (TCVN)"), "x-viet-tcvn5712" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
121 {N_("Vietnamese (VPS)"), "x-viet-vps" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
122 {N_("Western (MacRoman)"), "x-mac-roman" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
123 /* charsets whithout posibly translatable names */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
124 {"T61.8bit", "T61.8bit" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
125 {"x-imap4-modified-utf7", "x-imap4-modified-utf7"},
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
126 {"x-u-escaped", "x-u-escaped" },
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
127 {"windows-936", "windows-936" }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
128 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
129 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
130
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
131 /*************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
132 * Functions *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
133 *************/
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
134
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
135 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
136 * Commons conversion functions
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
137 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
138 char *convert_from_utf8_to_user(const char *string)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
139 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
140 return FLAC_plugin__charset_convert_string(string, "UTF-8", flac_cfg.title.user_char_set);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
141 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
142
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
143 char *convert_from_user_to_utf8(const char *string)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
144 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
145 return FLAC_plugin__charset_convert_string(string, flac_cfg.title.user_char_set, "UTF-8");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
146 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
147
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
148 GList *Charset_Create_List (void)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
149 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
150 GList *list = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
151 guint i;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
152
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
153 for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
154 list = g_list_append(list,_(charset_trans_array[i].charset_title));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
155 return list;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
156 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
157
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
158 GList *Charset_Create_List_UTF8_Only (void)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
159 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
160 GList *list = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
161
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
162 list = g_list_append(list,_(Charset_Get_Title_From_Name("UTF-8")));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
163 return list;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
164 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
165
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
166
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
167 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
168 * Return charset_name from charset_title
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
169 */
248
e557fce67f47 [svn] Avoid discarding pointer type qualifiers.
chainsaw
parents: 61
diff changeset
170 gchar *Charset_Get_Name_From_Title (const gchar *charset_title)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
171 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
172 guint i;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
173
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
174 if (charset_title)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
175 for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
176 if ( strcasecmp(_(charset_title),_(charset_trans_array[i].charset_title)) == 0 )
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
177 return charset_trans_array[i].charset_name;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
178 return "";
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
179 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
180
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
181
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
182 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
183 * Return charset_title from charset_name
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
184 */
248
e557fce67f47 [svn] Avoid discarding pointer type qualifiers.
chainsaw
parents: 61
diff changeset
185 gchar *Charset_Get_Title_From_Name (const gchar *charset_name)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
186 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
187 guint i;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
188
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
189 if (charset_name)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
190 for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
191 if ( strcasecmp(charset_name,charset_trans_array[i].charset_name) == 0 )
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
192 return _(charset_trans_array[i].charset_title);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
193 return "";
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
194 }