aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author2 <NotZed@Ximian.com>2001-10-13 06:27:22 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-13 06:27:22 +0800
commitd3f00283207c153d707c957ad657a97eb6494247 (patch)
tree1ebbc10f019642d2ab7e0769c475970d8fd128f7
parent16419940747f03ae8abca3fad025c95f382bc79b (diff)
downloadgsoc2013-evolution-d3f00283207c153d707c957ad657a97eb6494247.tar.gz
gsoc2013-evolution-d3f00283207c153d707c957ad657a97eb6494247.tar.zst
gsoc2013-evolution-d3f00283207c153d707c957ad657a97eb6494247.zip
Fix case of some entries to work with solaris, incl adding UTF-8.
2001-10-12 <NotZed@Ximian.com> * gal/util/e-iconv.c: Fix case of some entries to work with solaris, incl adding UTF-8. (e_iconv_init): Dont down-case the name, only the key. (e_iconv_charset_name): Use capitals for ISO and CP for Solaris's iconv to work. (e_iconv_open): If we can't convert, say we're not busy, so it gets re-used next open, spit out a warning. svn path=/trunk/; revision=13638
-rw-r--r--e-util/e-iconv.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/e-util/e-iconv.c b/e-util/e-iconv.c
index 35106577f0..da9b60cb64 100644
--- a/e-util/e-iconv.c
+++ b/e-util/e-iconv.c
@@ -45,7 +45,7 @@
#define ICONV_ISO_NEEDS_DASH (1)
#endif
-#define cd(x)
+#define cd(x)
#ifdef G_THREADS_ENABLED
static GStaticMutex lock = G_STATIC_MUTEX_INIT;
@@ -119,22 +119,24 @@ struct {
e_iconv_charset_name() so I'm not going to bother
putting them all in here either... */
#endif
- { "ks_c_5601-1987", "euc-kr" },
+ { "utf-8", "UTF-8" },
+
+ { "ks_c_5601-1987", "EUC-KR" },
/* FIXME: Japanese/Korean/Chinese stuff needs checking */
- { "euckr-0", "euc-kr" },
- { "big5-0", "big5" },
- { "big5.eten-0", "big5" },
- { "big5hkscs-0", "big5hkcs" },
+ { "euckr-0", "EUC-KR" },
+ { "big5-0", "BIG5" },
+ { "big5.eten-0", "BIG5" },
+ { "big5hkscs-0", "BIG5HKCS" },
{ "gb2312-0", "gb2312" },
{ "gb2312.1980-0", "gb2312" },
{ "gb18030-0", "gb18030" },
- { "gbk-0", "gbk" },
+ { "gbk-0", "GBK" },
- { "eucjp-0", "euc-jp" },
+ { "eucjp-0", "eucJP" },
{ "ujis-0", "ujis" },
- { "jisx0208.1983-0","shift-jis" },
- { "jisx0212.1990-0","shift-jis" },
+ { "jisx0208.1983-0","SJIS" },
+ { "jisx0212.1990-0","SJIS" },
{ NULL, NULL }
};
@@ -196,7 +198,6 @@ e_iconv_init(int keep)
from = g_strdup(known_iconv_charsets[i].charset);
to = g_strdup(known_iconv_charsets[i].iconv_name);
g_strdown(from);
- g_strdown(to);
g_hash_table_insert(iconv_charsets, from, to);
}
@@ -270,17 +271,17 @@ const char *e_iconv_charset_name(const char *charset)
#ifdef ICONV_ISO_NEEDS_DASH
ret = g_strdup_printf("iso-%s", tmp);
#else
- ret = g_strdup_printf("iso%s", tmp);
+ ret = g_strdup_printf("ISO%s", tmp);
#endif
} else if (strncmp(name, "windows-", 8) == 0) {
/* Convert windows-nnnnn or windows-cpnnnnn to cpnnnn */
tmp = name+8;
if (strncmp(tmp, "cp", 2))
tmp+=2;
- ret = g_strdup_printf("cp%s", tmp);
+ ret = g_strdup_printf("CP%s", tmp);
} else {
- /* Just assume its ok enough as is */
- ret = g_strdup(name);
+ /* Just assume its ok enough as is, case and all */
+ ret = g_strdup(charset);
}
g_hash_table_insert(iconv_charsets, g_strdup(name), ret);
@@ -322,7 +323,6 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
to = e_iconv_charset_name(oto);
from = e_iconv_charset_name(ofrom);
-
tofrom = alloca(strlen(to) +strlen(from) + 2);
sprintf(tofrom, "%s%%%s", to, from);
@@ -373,15 +373,19 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
e_dlist_addhead(&ic->open, (EDListNode *)in);
}
} else {
- ip = iconv_open(to, from);
cd(printf("creating new iconv converter '%s'\n", ic->conv));
+ ip = iconv_open(to, from);
in = g_malloc(sizeof(*in));
in->ip = ip;
- in->busy = TRUE;
in->parent = ic;
e_dlist_addhead(&ic->open, (EDListNode *)in);
- if (ip != (iconv_t)-1)
+ if (ip != (iconv_t)-1) {
g_hash_table_insert(iconv_cache_open, ip, in);
+ in->busy = TRUE;
+ } else {
+ g_warning("Could not open converter for '%s' to '%s' charset", from, to);
+ in->busy = FALSE;
+ }
}
UNLOCK();
-0/+4 * - Mark BROKEN: does not packagepav2008-05-301-0/+2 * - Fix pkg-plist.lippe2008-05-302-8/+2 * - Require automake and autoconf.lippe2008-05-301-1/+2 * - Unbreak startup script.lippe2008-05-301-2/+3 * Fix when NOPORTDOCS setmat2008-05-301-0/+2 * nbfc --> ports/lang/nbfcgahr2008-05-301-0/+1 * New port: The New Brainfuck Compilergahr2008-05-306-0/+48 * update to 3.42oliver2008-05-302-4/+4 * - fix build with portaudio, by backing out last patchesdinoex2008-05-301-5/+7 * - Add missing patchesmiwi2008-05-302-0/+29 * - Security update to 0.9.8hdinoex2008-05-303-13/+10 * - Update to 0.33.chinsan2008-05-302-4/+4 * - Update to 1.84.chinsan2008-05-302-4/+4 * Add one more hack for pkg-config path in gnomehack, (prefix)/lib/pkgconfig.mezz2008-05-301-0/+1 * Update to 1.1erwin2008-05-292-4/+4 * - Unbreak: make fetchable againgahr2008-05-291-2/+0 * Update to 0.80mat2008-05-292-4/+4 * Update to 0.19mat2008-05-292-4/+4 * Update to 0.90.10mat2008-05-292-4/+4 * Update to 1.0mat2008-05-292-5/+4 * - Update to 1.0dinoex2008-05-293-7/+8 * - pass flags to startup scriptdinoex2008-05-294-10/+12 * Use bzip2 distfile.flz2008-05-292-3/+4 * Remove the force file, if it was used.linimon2008-05-291-0/+1 * [PATCH] net/sniffit: Fix make package while NOPORTDOCS is definededwin2008-05-292-3/+3 * - Update to 2.3.4tabthorpe2008-05-296-14/+14 * - Update to 1.12.1miwi2008-05-292-4/+4 * Update to 1.13mat2008-05-292-5/+4 * Update to 0.77mat2008-05-292-4/+4 * - Woops fix buildmiwi2008-05-291-2/+2 * Fix dependency on dns/p5-Net-DNSedwin2008-05-291-1/+1 * - Update to r6129miwi2008-05-293-21/+9 * - Add gnash-devel to the buildmiwi2008-05-292-0/+2 * - Update to 20080515miwi2008-05-293-14/+31 * Add upstream patch (don't free not-allocated dbus socket).flz2008-05-292-1/+15 * This is a security update of Samba 3.0.28a, that address CVE-2008-1105.timur2008-05-292-1/+188 * - Update to 2.3.0miwi2008-05-293-15/+16 * - Update to 1.9.1miwi2008-05-293-39/+14 * Upgrade module spam-1.350-1.olgeni2008-05-292-1/+5 * yzis --> ports/editors/yzismiwi2008-05-291-0/+1 * Yzis a vi-like editor inspired by Vim.miwi2008-05-297-0/+277 * - Fix buildmiwi2008-05-292-4/+3 * Update to 1.203lth2008-05-293-5/+7 * Presenting GNOME 2.22.2 for FreeBSD.marcus2008-05-291-1/+1 * . Update to 2.5.4b.glewis2008-05-292-5/+5 * cacheboy --> ports/www/cacheboyerwin2008-05-291-0/+1 * - Unbreak for pf < 3.7rafan2008-05-296-46/+293 * php-tclink --> ports/finance/php-tclinkchinsan2008-05-291-0/+1 * TCLink is a thin client API that allows a merchant to process credit cardchinsan2008-05-294-0/+31 * Add a force function here, just like processlogs.linimon2008-05-291-1/+1 * p5-Net-XMPP2 --> ports/net-im/p5-Net-XMPP2edwin2008-05-291-0/+1 * [NEW PORT] net-im/p5-Net-XMPP2: An implementation of the XMPP Protocoledwin2008-05-295-0/+150 * patch net/libnet's configure to not do anymore checks of bpf deviceedwin2008-05-292-1/+81 * net/vnc Xvnc won't run without fonts.alias installededwin2008-05-291-2/+3 * Add a note that processonelog and processlogs2 are finicky about thelinimon2008-05-291-0/+1 * Fix these after the 1.31 update to buildscript.linimon2008-05-292-5/+7 * netident --> ports/sysutils/netidentedwin2008-05-291-0/+1 * New Port: net/netident A port for testing what network a machineedwin2008-05-29