/* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000-2006, 2008-2018 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>. */
#include <config.h>
/* Specification. */
#include "localcharset.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
#endif
#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
# include <locale.h>
#endif
#if defined __EMX__
/* Assume EMX program runs on OS/2, even if compiled under DOS. */
# ifndef OS2
# define OS2
# endif
#endif
#if !defined WINDOWS_NATIVE
# if HAVE_LANGINFO_CODESET
# include <langinfo.h>
# else
# if 0 /* see comment regarding use of setlocale(), below */
# include <locale.h>
# endif
# endif
# ifdef __CYGWIN__
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# endif
#elif defined WINDOWS_NATIVE
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
#if defined OS2
# define INCL_DOS
# include <os2.h>
#endif
/* For MB_CUR_MAX_L */
#if defined DARWIN7
# include <xlocale.h>
#endif
#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
/* On these platforms, we use a mapping from non-canonical encoding name
to GNU canonical encoding name. */
/* With glibc-2.1 or newer, we don't need any canonicalization,
because glibc has iconv and both glibc and libiconv support all
GNU canonical names directly. */
# if !((defined __GNU_LIBRARY__ && __GLIBC__ >= 2) || defined __UCLIBC__)
struct table_entry
{
const char alias[11+1];
const char canonical[11+1];
};
/* Table of platform-dependent mappings, sorted in ascending order. */
static const struct table_entry alias_table[] =
{
# if defined __FreeBSD__ /* FreeBSD */
/*{ "ARMSCII-8", "ARMSCII-8" },*/
{ "Big5", "BIG5" },
{ "C", "ASCII" },
/*{ "CP1131", "CP1131" },*/
/*{ "CP1251", "CP1251" },*/
/*{ "CP866", "CP866" },*/
/*{ "GB18030", "GB18030" },*/
/*{ "GB2312", "GB2312" },*/
/*{ "GBK", "GBK" },*/
/*{ "ISCII-DEV", "?" },*/
{ "ISO8859-1", "ISO-8859-1" },
{ "ISO8859-13", "ISO-8859-13" },
{ "ISO8859-15", "ISO-8859-15" },
{ "ISO8859-2", "ISO-8859-2" },
{ "ISO8859-5", "ISO-8859-5" },
{ "ISO8859-7", "ISO-8859-7" },
{ "ISO8859-9", "ISO-8859-9" },
/*{ "KOI8-R", "KOI8-R" },*/
/*{ "KOI8-U", "KOI8-U" },*/
{ "SJIS", "SHIFT_JIS" },
{ "US-ASCII", "ASCII" },
{ "eucCN", "GB2312" },
{ "eucJP", "EUC-JP" },
{ "eucKR", "EUC-KR" }
# define alias_table_defined
# endif
# if defined __NetBSD__ /* NetBSD */
{ "646", "ASCII" },
/*{ "ARMSCII-8", "ARMSCII-8" },*/
/*{ "BIG5", "BIG5" },*/
{ "Big5-HKSCS", "BIG5-HKSCS" },
/*{ "CP1251", "CP1251" },*/
/*{ "CP866", "CP866" },*/
/*{ "GB18030", "GB18030" },*/
/*{ "GB2312", "GB2312" },*/
{ "ISO8859-1", "ISO-8859-1" },
{ "ISO8859-13", "ISO-8859-13" },
{ "ISO8859-15", "ISO-8859-15" },
{ "ISO8859-2", "ISO-8859-2" },
{ "ISO8859-4", "ISO-8859-4" },
{ "ISO8859-5", "ISO-8859-5" },
{ "ISO8859-7", "ISO-8859-7" },
/*{ "KOI8-R", "KOI8-R" },*/
/*{ "KOI8-U", "KOI8-U" },*/
/*{ "PT154", "PT154" },*/
{ "SJIS", "SHIFT_JIS" },
{ "eucCN", "GB2312" },
{ "eucJP", "EUC-JP" },
{ "eucKR", "EUC-KR" },
{ "eucTW", "EUC-TW" }
# define alias_table_defined
# endif
# if defined __OpenBSD__ /* OpenBSD */
{ "646", "ASCII" },
{ "ISO8859-1", "ISO-8859-1" },
{ "ISO8859-13", "ISO-8859-13" },
{ "ISO8859-15", "ISO-8859-15" },
{ "ISO8859-2", "ISO-8859-2" },
{ "ISO8859-4", "ISO-8859-4" },
{ "ISO8859-5", "ISO-8859-5" },
{ "ISO8859-7", "ISO-8859-7" }
# define alias_table_defined
# endif
# if defined __APPLE__ && defined __MACH__ /* Mac OS X */
/* Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
useless:
- It returns the empty string when LANG is set to a locale of the
form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
LC_CTYPE file.
- The environment variables LANG, LC_CTYPE, LC_ALL are not set by
the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
- The documentation says:
"... all code that calls BSD system routines should ensure
that the const *char parameters of these routines are in UTF-8
encoding. All BSD system functions expect their string
parameters to be in UTF-8 encoding and nothing else."
It also says
"An additional caveat is that string parameters for files,
paths, and other file-system entities must be in canonical
UTF-8. In a canonical UTF-8 Unicode string, all decomposable
characters are decomposed ..."
but this is not true: You can pass non-decomposed UTF-8 strings
to file system functions, and it is the OS which will convert
them to decomposed UTF-8 before accessing the file system.
- The Apple Terminal application displays UTF-8 by default.
- However, other applications are free to use different encodings:
- xterm uses ISO-8859-1 by default.
- TextEdit uses MacRoman by default.
We prefer UTF-8 over decomposed UTF-8-MAC because one should
minimize the use of decomposed Unicode. Unfortunately, through the
Darwin file system, decomposed UTF-8 strings are leaked into user
space nevertheless.
Then there are also the locales with encodings other than US-ASCII
and UTF-8. These locales can be occasionally useful to users (e.g.
when grepping through ISO-8859-1 encoded text files), when all their
file names are in US-ASCII.
*/
{ "ARMSCII-8", "ARMSCII-8" },
{ "Big5", "BIG5" },
{ "Big5HKSCS", "BIG5-HKSCS" },
{ "CP1131", "CP1131" },
{ "CP1251", "CP1251" },
{ "CP866", "CP866" },
{ "CP949", "CP949" },
{ "GB18030", "GB18030" },
{ "GB2312", "GB2312" },
{ "GBK", "GBK" },
/*{ "ISCII-DEV", "?" },*/
{ "ISO8859-1", "ISO-8859-1" },
{ "ISO8859-13", "ISO-8859-13" },
{ "ISO8859-15", "ISO-8859-15" },
{ "ISO8859-2", "ISO-8859-2" },
{ "ISO8859-4", "ISO-8859-4" },
{ "ISO8859-5", "ISO-8859-5" },
{ "ISO8859-7", "ISO-8859-7" },
{ "ISO8859-9", "ISO-8859-9" },
{ "KOI8-R", "KOI8-R" },
{ "KOI8-U", "KOI8-U" },
{ "PT154", "PT154" },
{ "SJIS", "SHIFT_JIS" },
{ "eucCN", "GB2312" },
{ "eucJP", "EUC-JP" },
{ "eucKR", "EUC-KR" }
# define alias_table_defined
# endif
# if defined _AIX /* AIX */
/*{ "GBK", "GBK" },*/
{ "IBM-1046", "CP1046" },
{ "IBM-1124", "CP1124" },
{ "IBM-1129", "CP1129" },
{ "IBM-1252", "CP1252" },
{ "IBM-850", "CP850" },
{ "IBM-856", "CP856" },
{ "IBM-921", "ISO-8859-13" },
{ "IBM-922", "CP922" },
没有合适的资源?快使用搜索试试~ 我知道了~
libconv源代码与生成的库
共287个文件
h:224个
tlog:17个
def:7个
需积分: 0 15 下载量 73 浏览量
2023-09-09
21:48:22
上传
评论
收藏 16.56MB RAR 举报
温馨提示
可以直接用编译后的静态库,也可以自己从源代码编译得到静态库。 代码从官网下载,经过一些修改,可以编过。
资源推荐
资源详情
资源评论
收起资源包目录
libconv源代码与生成的库 (287个子文件)
localcharset.c 33KB
relocatable.c 18KB
iconv.c 16KB
gentranslit.c 8KB
genaliases.c 4KB
genflags.c 4KB
genaliases2.c 3KB
libconv.vcxprojResolveAssemblyReference.cache 713B
translit.def 156KB
encodings.def 38KB
encodings_dos.def 5KB
encodings_aix.def 3KB
encodings_extra.def 2KB
encodings_osf1.def 1KB
encodings_local.def 1KB
libconv.vcxproj.filters 1KB
aliases_syshpux.gperf 8KB
aliases_sysaix.gperf 8KB
aliases_syssolaris.gperf 8KB
aliases_sysosf1.gperf 8KB
aliases.gperf 8KB
cns11643_inv.h 935KB
jisx0213.h 275KB
big5.h 256KB
cjk_variants.h 248KB
ksc5601.h 182KB
hkscs1999.h 182KB
gb2312.h 154KB
gbkext_inv.h 147KB
jisx0208.h 145KB
jisx0212.h 131KB
gb12345ext.h 105KB
translit.h 96KB
uhc_1.h 82KB
cns11643_5.h 74KB
aliases_syshpux.h 74KB
aliases_syssolaris.h 74KB
aliases_sysaix.h 74KB
aliases_sysosf1.h 73KB
gbkext2.h 69KB
aliases.h 69KB
cns11643_2.h 64KB
cns11643_15.h 63KB
cns11643_7.h 57KB
cns11643_3.h 56KB
cns11643_6.h 56KB
gbkext1.h 51KB
cns11643_1.h 51KB
uhc_2.h 47KB
isoir165ext.h 45KB
cns11643_4b.h 39KB
cp932ext.h 39KB
hkscs2001.h 33KB
hkscs2004.h 32KB
cns11643_4a.h 27KB
hkscs2008.h 21KB
big5_2003.h 20KB
iso2022_jp2.h 18KB
loop_unicode.h 17KB
iso2022_cnext.h 16KB
iso2022_jp3.h 15KB
loop_wchar.h 15KB
gb18030ext.h 14KB
gb18030.h 14KB
cp1255.h 13KB
iso2022_jpms.h 12KB
vietcomb.h 12KB
gb18030uni.h 12KB
tcvn.h 11KB
cp950.h 11KB
cp1258.h 10KB
utf7.h 10KB
johab_hangul.h 10KB
shift_jisx0213.h 10KB
iconv.h 9KB
iconv.h 9KB
euc_jisx0213.h 9KB
iso2022_cn.h 8KB
converters.h 8KB
flags.h 8KB
cp864.h 8KB
koi8_u.h 7KB
koi8_ru.h 7KB
cp932.h 7KB
mac_croatian.h 7KB
mac_romania.h 7KB
cp50221_0212_ext.h 7KB
mac_roman.h 7KB
mac_turkish.h 7KB
big5hkscs2008.h 7KB
mac_iceland.h 7KB
atarist.h 7KB
canonical_syshpux.h 7KB
canonical.h 7KB
canonical_sysosf1.h 7KB
cp865.h 7KB
cp863.h 7KB
cp861.h 7KB
cp437.h 7KB
koi8_r.h 7KB
共 287 条
- 1
- 2
- 3
资源评论
码猿杂谈
- 粉丝: 178
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功