summaryrefslogtreecommitdiffstats
path: root/gl/localcharset.c
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2009-05-20 00:32:10 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2009-05-20 00:32:10 +0200
commit50b3ff7b91e78a61aca93247bee586d6d7eb27c8 (patch)
treedb4c7eee24479ac7ee6888ce1562facf60159b71 /gl/localcharset.c
parent2701ccd500e60537a8c2977a81549ff33eeaef3f (diff)
downloadmonitoring-plugins-50b3ff7b91e78a61aca93247bee586d6d7eb27c8.tar.gz
Sync with the latest Gnulib code (cb75dc5)
Signed-off-by: Holger Weiss <holger@zedat.fu-berlin.de>
Diffstat (limited to 'gl/localcharset.c')
-rw-r--r--gl/localcharset.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/gl/localcharset.c b/gl/localcharset.c
index 68679cf8..a7ca94c1 100644
--- a/gl/localcharset.c
+++ b/gl/localcharset.c
@@ -1,6 +1,6 @@
1/* Determine a canonical name for the current locale's character encoding. 1/* Determine a canonical name for the current locale's character encoding.
2 2
3 Copyright (C) 2000-2006, 2008 Free Software Foundation, Inc. 3 Copyright (C) 2000-2006, 2008-2009 Free Software Foundation, Inc.
4 4
5 This program is free software; you can redistribute it and/or modify 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 6 it under the terms of the GNU General Public License as published by
@@ -28,6 +28,10 @@
28#include <string.h> 28#include <string.h>
29#include <stdlib.h> 29#include <stdlib.h>
30 30
31#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
32# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */
33#endif
34
31#if defined _WIN32 || defined __WIN32__ 35#if defined _WIN32 || defined __WIN32__
32# define WIN32_NATIVE 36# define WIN32_NATIVE
33#endif 37#endif
@@ -112,7 +116,7 @@ get_charset_aliases (void)
112 cp = charset_aliases; 116 cp = charset_aliases;
113 if (cp == NULL) 117 if (cp == NULL)
114 { 118 {
115#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) 119#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
116 FILE *fp; 120 FILE *fp;
117 const char *dir; 121 const char *dir;
118 const char *base = "charset.alias"; 122 const char *base = "charset.alias";
@@ -213,6 +217,39 @@ get_charset_aliases (void)
213 217
214#else 218#else
215 219
220# if defined DARWIN7
221 /* To avoid the trouble of installing a file that is shared by many
222 GNU packages -- many packaging systems have problems with this --,
223 simply inline the aliases here. */
224 cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
225 "ISO8859-2" "\0" "ISO-8859-2" "\0"
226 "ISO8859-4" "\0" "ISO-8859-4" "\0"
227 "ISO8859-5" "\0" "ISO-8859-5" "\0"
228 "ISO8859-7" "\0" "ISO-8859-7" "\0"
229 "ISO8859-9" "\0" "ISO-8859-9" "\0"
230 "ISO8859-13" "\0" "ISO-8859-13" "\0"
231 "ISO8859-15" "\0" "ISO-8859-15" "\0"
232 "KOI8-R" "\0" "KOI8-R" "\0"
233 "KOI8-U" "\0" "KOI8-U" "\0"
234 "CP866" "\0" "CP866" "\0"
235 "CP949" "\0" "CP949" "\0"
236 "CP1131" "\0" "CP1131" "\0"
237 "CP1251" "\0" "CP1251" "\0"
238 "eucCN" "\0" "GB2312" "\0"
239 "GB2312" "\0" "GB2312" "\0"
240 "eucJP" "\0" "EUC-JP" "\0"
241 "eucKR" "\0" "EUC-KR" "\0"
242 "Big5" "\0" "BIG5" "\0"
243 "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
244 "GBK" "\0" "GBK" "\0"
245 "GB18030" "\0" "GB18030" "\0"
246 "SJIS" "\0" "SHIFT_JIS" "\0"
247 "ARMSCII-8" "\0" "ARMSCII-8" "\0"
248 "PT154" "\0" "PT154" "\0"
249 /*"ISCII-DEV" "\0" "?" "\0"*/
250 "*" "\0" "UTF-8" "\0";
251# endif
252
216# if defined VMS 253# if defined VMS
217 /* To avoid the troubles of an extra file charset.alias_vms in the 254 /* To avoid the troubles of an extra file charset.alias_vms in the
218 sources of many GNU packages, simply inline the aliases here. */ 255 sources of many GNU packages, simply inline the aliases here. */