version 1.1, 2012/02/21 22:57:48
|
version 1.1.1.3, 2021/03/17 13:38:46
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (C) 1999-2008 Free Software Foundation, Inc. | * Copyright (C) 1999-2008, 2011, 2016, 2018 Free Software Foundation, Inc. |
* This file is part of the GNU LIBICONV Library. |
* This file is part of the GNU LIBICONV Library. |
* |
* |
* The GNU LIBICONV Library is free software; you can redistribute it |
* The GNU LIBICONV Library is free software; you can redistribute it |
Line 14
|
Line 14
|
* |
* |
* You should have received a copy of the GNU Library General Public |
* You should have received a copy of the GNU Library General Public |
* License along with the GNU LIBICONV Library; see the file COPYING.LIB. |
* License along with the GNU LIBICONV Library; see the file COPYING.LIB. |
* If not, write to the Free Software Foundation, Inc., 51 Franklin Street, | * If not, see <https://www.gnu.org/licenses/>. |
* Fifth Floor, Boston, MA 02110-1301, USA. | |
*/ |
*/ |
|
|
#include <iconv.h> |
#include <iconv.h> |
|
|
|
#include <limits.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include "config.h" |
#include "config.h" |
#include "localcharset.h" |
#include "localcharset.h" |
|
|
|
#ifdef __CYGWIN__ |
|
#include <cygwin/version.h> |
|
#endif |
|
|
#if ENABLE_EXTRA |
#if ENABLE_EXTRA |
/* |
/* |
* Consider all system dependent encodings, for any system, |
* Consider all system dependent encodings, for any system, |
Line 174 static const struct alias sysdep_aliases[] = {
|
Line 178 static const struct alias sysdep_aliases[] = {
|
}; |
}; |
#ifdef __GNUC__ |
#ifdef __GNUC__ |
__inline |
__inline |
|
#else |
|
#ifdef __cplusplus |
|
inline |
#endif |
#endif |
const struct alias * | #endif |
| static const struct alias * |
aliases2_lookup (register const char *str) |
aliases2_lookup (register const char *str) |
{ |
{ |
const struct alias * ptr; |
const struct alias * ptr; |
Line 549 const char * iconv_canonicalize (const char * name)
|
Line 557 const char * iconv_canonicalize (const char * name)
|
} |
} |
if (ap->encoding_index == ei_local_wchar_t) { |
if (ap->encoding_index == ei_local_wchar_t) { |
/* On systems which define __STDC_ISO_10646__, wchar_t is Unicode. |
/* On systems which define __STDC_ISO_10646__, wchar_t is Unicode. |
This is also the case on native Woe32 systems. */ | This is also the case on native Woe32 systems and Cygwin >= 1.7, where |
#if __STDC_ISO_10646__ || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) | we know that it is UTF-16. */ |
| #if (defined _WIN32 && !defined __CYGWIN__) || (defined __CYGWIN__ && CYGWIN_VERSION_DLL_MAJOR >= 1007) |
| if (sizeof(wchar_t) == 4) { |
| index = ei_ucs4internal; |
| break; |
| } |
| if (sizeof(wchar_t) == 2) { |
| # if WORDS_LITTLEENDIAN |
| index = ei_utf16le; |
| # else |
| index = ei_utf16be; |
| # endif |
| break; |
| } |
| #elif __STDC_ISO_10646__ |
if (sizeof(wchar_t) == 4) { |
if (sizeof(wchar_t) == 4) { |
index = ei_ucs4internal; |
index = ei_ucs4internal; |
break; |
break; |