1N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 1N/A * The contents of this file are subject to the Netscape Public 1N/A * License Version 1.1 (the "License"); you may not use this file 1N/A * except in compliance with the License. You may obtain a copy of 1N/A * Software distributed under the License is distributed on an "AS 1N/A * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 1N/A * implied. See the License for the specific language governing 1N/A * rights and limitations under the License. 1N/A * The Original Code is Mozilla Communicator client code, released 1N/A * The Initial Developer of the Original Code is Netscape 1N/A * Communications Corporation. Portions created by Netscape are 1N/A * Copyright (C) 1998-1999 Netscape Communications Corporation. All 1N/A#
endif /* SOLARIS_LDAP_CMD */ 1N/A * ICU version always returns string, unless strdup fails. 1N/A * As in ICU version, in case of error strdup(src) 1N/A * Usually strdup(src) will be ASCII and legal anyways. 1N/A /* conversion table not available */ 1N/A /* maybe sizeof strlen(src) memory still exists */ 1N/A * Success. Place 'cd' into its initial shift 1N/A * state before returning. 1N/A * Lack of space in output buffer. 1N/A * Hence double the size and retry. 1N/A * But before calling iconv(), oleft 1N/A * and tptr have to re-adjusted, so that 1N/A * iconv() doesn't overwrite the data 1N/A * which has already been converted. 1N/A /* Free malloc'ed memory on failure */ 1N/A /* NULL terminate the return value */ 1N/A /* realloc one more byte and NULL terminate */ 1N/A /* last chance in case some other failure along the way occurs */ 1N/A#
endif /* SOLARIS_LDAP_CMD */ 1N/A#
endif /* SOLARIS_LDAP_CMD */ 1N/A#
else /* HAVE_LIBICU */ 1N/A"! This table maps the host's locale names to IANA charsets",
1N/A"C: ISO_8859-1:1987",
1N/A"cs: ISO_8859-2:1987",
1N/A"da: ISO_8859-1:1987",
1N/A"de: ISO_8859-1:1987",
1N/A"de_AT: ISO_8859-1:1987",
1N/A"de_CH: ISO_8859-1:1987",
1N/A"en: ISO_8859-1:1987",
1N/A"en_AU: ISO_8859-1:1987",
1N/A"en_CA: ISO_8859-1:1987",
1N/A"en_TH: ISO_8859-1:1987",
1N/A"en_US: ISO_8859-1:1987",
1N/A"es: ISO_8859-1:1987",
1N/A"fi: ISO_8859-1:1987",
1N/A"fr: ISO_8859-1:1987",
1N/A"fr_BE: ISO_8859-1:1987",
1N/A"fr_CA: ISO_8859-1:1987",
1N/A"fr_CH: ISO_8859-1:1987",
1N/A"is: ISO_8859-1:1987",
1N/A"it: ISO_8859-1:1987",
1N/A"it_CH: ISO_8859-1:1987",
1N/A"ja_JP.EUC: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"nl: ISO_8859-1:1987",
1N/A"nl_BE: ISO_8859-1:1987",
1N/A"no: ISO_8859-1:1987",
1N/A"pl: ISO_8859-2:1987",
1N/A"pt: ISO_8859-1:1987",
1N/A"sh: ISO_8859-2:1987",
1N/A"sk: ISO_8859-2:1987",
1N/A"sv: ISO_8859-1:1987",
1N/A"zh_TW.ucns: cns11643_1",
1N/A"! This table maps the host's locale names to IANA charsets",
1N/A"C: ISO_8859-1:1987",
1N/A"ja: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ja_JP.EUC: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ja_JP.PCK: Shift_JIS",
1N/A"en: ISO_8859-1:1987",
1N/A"en_AU: ISO_8859-1:1987",
1N/A"en_CA: ISO_8859-1:1987",
1N/A"en_UK: ISO_8859-1:1987",
1N/A"en_US: ISO_8859-1:1987",
1N/A"es: ISO_8859-1:1987",
1N/A"es_AR: ISO_8859-1:1987",
1N/A"es_BO: ISO_8859-1:1987",
1N/A"es_CL: ISO_8859-1:1987",
1N/A"es_CO: ISO_8859-1:1987",
1N/A"es_CR: ISO_8859-1:1987",
1N/A"es_EC: ISO_8859-1:1987",
1N/A"es_GT: ISO_8859-1:1987",
1N/A"es_MX: ISO_8859-1:1987",
1N/A"es_NI: ISO_8859-1:1987",
1N/A"es_PA: ISO_8859-1:1987",
1N/A"es_PE: ISO_8859-1:1987",
1N/A"es_PY: ISO_8859-1:1987",
1N/A"es_SV: ISO_8859-1:1987",
1N/A"es_UY: ISO_8859-1:1987",
1N/A"es_VE: ISO_8859-1:1987",
1N/A"fr: ISO_8859-1:1987",
1N/A"fr_BE: ISO_8859-1:1987",
1N/A"fr_CA: ISO_8859-1:1987",
1N/A"fr_CH: ISO_8859-1:1987",
1N/A"de: ISO_8859-1:1987",
1N/A"de_AT: ISO_8859-1:1987",
1N/A"de_CH: ISO_8859-1:1987",
1N/A"nl: ISO_8859-1:1987",
1N/A"nl_BE: ISO_8859-1:1987",
1N/A"it: ISO_8859-1:1987",
1N/A"sv: ISO_8859-1:1987",
1N/A"no: ISO_8859-1:1987",
1N/A"da: ISO_8859-1:1987",
1N/A"iso_8859_1: ISO_8859-1:1987",
1N/A"japanese: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"! This table maps the host's locale names to IANA charsets",
1N/A"C: ISO_8859-1:1987",
1N/A"cs_CZ.ISO8859-2: ISO_8859-2:1987",
1N/A"cs_CZ: ISO_8859-2:1987",
1N/A"da_DK.ISO8859-1: ISO_8859-1:1987",
1N/A"de_CH.ISO8859-1: ISO_8859-1:1987",
1N/A"de_DE.ISO8859-1: ISO_8859-1:1987",
1N/A"en_GB.ISO8859-1: ISO_8859-1:1987",
1N/A"en_US.ISO8859-1: ISO_8859-1:1987",
1N/A"es_ES.ISO8859-1: ISO_8859-1:1987",
1N/A"fi_FI.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_BE.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_CA.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_CH.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_FR.ISO8859-1: ISO_8859-1:1987",
1N/A"hu_HU.ISO8859-2: ISO_8859-2:1987",
1N/A"hu_HU: ISO_8859-2:1987",
1N/A"is_IS.ISO8859-1: ISO_8859-1:1987",
1N/A"it_IT.ISO8859-1: ISO_8859-1:1987",
1N/A"ja_JP.SJIS: Shift_JIS",
1N/A"ja_JP.eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ja_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ko_KR.eucKR: EUC-KR",
1N/A"nl_BE.ISO8859-1: ISO_8859-1:1987",
1N/A"nl_NL.ISO8859-1: ISO_8859-1:1987",
1N/A"no_NO.ISO8859-1: ISO_8859-1:1987",
1N/A"pl_PL.ISO8859-2: ISO_8859-2:1987",
1N/A"pl_PL: ISO_8859-2:1987",
1N/A"pt_PT.ISO8859-1: ISO_8859-1:1987",
1N/A"sk_SK.ISO8859-2: ISO_8859-2:1987",
1N/A"sk_SK: ISO_8859-2:1987",
1N/A"sv_SE.ISO8859-1: ISO_8859-1:1987",
1N/A"zh_HK.eucTW: cns11643_1",
1N/A"zh_TW.big5@chuyin: Big5",
1N/A"zh_TW.big5@radical: Big5",
1N/A"zh_TW.big5@stroke: Big5",
1N/A"zh_TW.eucTW: cns11643_1",
1N/A"zh_TW.eucTW@chuyin: cns11643_1",
1N/A"zh_TW.eucTW@radical: cns11643_1",
1N/A"zh_TW.eucTW@stroke: cns11643_1",
1N/A"! This table maps the host's locale names to IANA charsets",
1N/A"C: ISO_8859-1:1987",
1N/A"ja_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ja_JP.SJIS: Shift_JIS",
1N/A"ja_JP.eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"es_ES: ISO_8859-1:1987",
1N/A"es_ES.iso88591: ISO_8859-1:1987",
1N/A"sv_SE: ISO_8859-1:1987",
1N/A"sv_SE.iso88591: ISO_8859-1:1987",
1N/A"da_DK: ISO_8859-1:1987",
1N/A"da_DK.iso88591: ISO_8859-1:1987",
1N/A"nl_NL: ISO_8859-1:1987",
1N/A"nl_NL.iso88591: ISO_8859-1:1987",
1N/A"en: ISO_8859-1:1987",
1N/A"en_GB: ISO_8859-1:1987",
1N/A"en_GB.iso88591: ISO_8859-1:1987",
1N/A"en_US: ISO_8859-1:1987",
1N/A"en_US.iso88591: ISO_8859-1:1987",
1N/A"fi_FI: ISO_8859-1:1987",
1N/A"fi_FI.iso88591: ISO_8859-1:1987",
1N/A"fr_CA: ISO_8859-1:1987",
1N/A"fr_CA.iso88591: ISO_8859-1:1987",
1N/A"fr_FR: ISO_8859-1:1987",
1N/A"fr_FR.iso88591: ISO_8859-1:1987",
1N/A"de_DE: ISO_8859-1:1987",
1N/A"de_DE.iso88591: ISO_8859-1:1987",
1N/A"is_IS: ISO_8859-1:1987",
1N/A"is_IS.iso88591: ISO_8859-1:1987",
1N/A"it_IT: ISO_8859-1:1987",
1N/A"it_IT.iso88591: ISO_8859-1:1987",
1N/A"no_NO: ISO_8859-1:1987",
1N/A"no_NO.iso88591: ISO_8859-1:1987",
1N/A"pt_PT: ISO_8859-1:1987",
1N/A"pt_PT.iso88591: ISO_8859-1:1987",
1N/A"hu_HU: ISO_8859-2:1987",
1N/A"hu_HU.iso88592: ISO_8859-2:1987",
1N/A"cs_CZ: ISO_8859-2:1987",
1N/A"cs_CZ.iso88592: ISO_8859-2:1987",
1N/A"pl_PL: ISO_8859-2:1987",
1N/A"pl_PL.iso88592: ISO_8859-2:1987",
1N/A"ro_RO: ISO_8859-2:1987",
1N/A"ro_RO.iso88592: ISO_8859-2:1987",
1N/A"hr_HR: ISO_8859-2:1987",
1N/A"hr_HR.iso88592: ISO_8859-2:1987",
1N/A"sk_SK: ISO_8859-2:1987",
1N/A"sk_SK.iso88592: ISO_8859-2:1987",
1N/A"sl_SI: ISO_8859-2:1987",
1N/A"sl_SI.iso88592: ISO_8859-2:1987",
1N/A"american.iso88591: ISO_8859-1:1987",
1N/A"bulgarian: ISO_8859-2:1987",
1N/A"c-french.iso88591: ISO_8859-1:1987",
1N/A"chinese-t.big5: Big5",
1N/A"czech: ISO_8859-2:1987",
1N/A"danish.iso88591: ISO_8859-1:1987",
1N/A"dutch.iso88591: ISO_8859-1:1987",
1N/A"english.iso88591: ISO_8859-1:1987",
1N/A"finnish.iso88591: ISO_8859-1:1987",
1N/A"french.iso88591: ISO_8859-1:1987",
1N/A"german.iso88591: ISO_8859-1:1987",
1N/A"hungarian: ISO_8859-2:1987",
1N/A"icelandic.iso88591: ISO_8859-1:1987",
1N/A"italian.iso88591: ISO_8859-1:1987",
1N/A"japanese.euc: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"japanese: Shift_JIS",
1N/A"katakana: Shift_JIS",
1N/A"norwegian.iso88591: ISO_8859-1:1987",
1N/A"polish: ISO_8859-2:1987",
1N/A"portuguese.iso88591: ISO_8859-1:1987",
1N/A"rumanian: ISO_8859-2:1987",
1N/A"serbocroatian: ISO_8859-2:1987",
1N/A"slovene: ISO_8859-2:1987",
1N/A"spanish.iso88591: ISO_8859-1:1987",
1N/A"swedish.iso88591: ISO_8859-1:1987",
1N/A"! This table maps the host's locale names to IANA charsets",
1N/A"C: ISO_8859-1:1987",
1N/A"En_JP.IBM-932: Shift_JIS",
1N/A"Ja_JP.IBM-932: Shift_JIS",
1N/A"da_DK.ISO8859-1: ISO_8859-1:1987",
1N/A"da_DK: ISO_8859-1:1987",
1N/A"de_CH.ISO8859-1: ISO_8859-1:1987",
1N/A"de_CH: ISO_8859-1:1987",
1N/A"de_DE.ISO8859-1: ISO_8859-1:1987",
1N/A"de_DE: ISO_8859-1:1987",
1N/A"en_GB.ISO8859-1: ISO_8859-1:1987",
1N/A"en_GB: ISO_8859-1:1987",
1N/A"en_JP.IBM-eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"en_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"en_KR.IBM-eucKR: EUC-KR",
1N/A"en_TW.IBM-eucTW: cns11643_1",
1N/A"en_US.ISO8859-1: ISO_8859-1:1987",
1N/A"en_US: ISO_8859-1:1987",
1N/A"es_ES.ISO8859-1: ISO_8859-1:1987",
1N/A"es_ES: ISO_8859-1:1987",
1N/A"fi_FI.ISO8859-1: ISO_8859-1:1987",
1N/A"fi_FI: ISO_8859-1:1987",
1N/A"fr_BE.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_BE: ISO_8859-1:1987",
1N/A"fr_CA.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_CA: ISO_8859-1:1987",
1N/A"fr_CH.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_CH: ISO_8859-1:1987",
1N/A"fr_FR.ISO8859-1: ISO_8859-1:1987",
1N/A"fr_FR: ISO_8859-1:1987",
1N/A"is_IS.ISO8859-1: ISO_8859-1:1987",
1N/A"is_IS: ISO_8859-1:1987",
1N/A"it_IT.ISO8859-1: ISO_8859-1:1987",
1N/A"it_IT: ISO_8859-1:1987",
1N/A"ja_JP.IBM-eucJP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ja_JP: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ko_KR.IBM-eucKR: EUC-KR",
1N/A"nl_BE.ISO8859-1: ISO_8859-1:1987",
1N/A"nl_BE: ISO_8859-1:1987",
1N/A"nl_NL.ISO8859-1: ISO_8859-1:1987",
1N/A"nl_NL: ISO_8859-1:1987",
1N/A"no_NO.ISO8859-1: ISO_8859-1:1987",
1N/A"no_NO: ISO_8859-1:1987",
1N/A"pt_PT.ISO8859-1: ISO_8859-1:1987",
1N/A"pt_PT: ISO_8859-1:1987",
1N/A"sv_SE.ISO8859-1: ISO_8859-1:1987",
1N/A"sv_SE: ISO_8859-1:1987",
1N/A"zh_TW.IBM-eucTW: cns11643_1",
1N/A#
else // sunos by default 1N/A"! This table maps the host's locale names to IANA charsets",
1N/A"C: ISO_8859-1:1987",
1N/A"de: ISO_8859-1:1987",
1N/A"en_US: ISO_8859-1:1987",
1N/A"es: ISO_8859-1:1987",
1N/A"fr: ISO_8859-1:1987",
1N/A"iso_8859_1: ISO_8859-1:1987",
1N/A"it: ISO_8859-1:1987",
1N/A"ja: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"ja_JP.EUC: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"japanese: Extended_UNIX_Code_Packed_Format_for_Japanese",
1N/A"sv: ISO_8859-1:1987",
1N/A while (*++p ==
' ' || *p ==
'\t')
1N/A#
endif /* Not defined XP_WIN32 */ 1N/A /* output never becomes longer than input, 1N/A * thus we don't have to ask for the length 1N/A /* no option specified, so assume it's already in utf-8 */ 1N/A /* zero option specified, so try to get default codepage 1N/A this sucker is strdup'd immediately so it's OK to cast */ 1N/A /* the default codepage lives in ICU */ 1N/A /* -i option specified with charset name */ 1N/A /* do the preflight - get the size needed for the target buffer */ 1N/A /* default to just a copy of the string - this covers 1N/A the case of an illegal charset also */ 1N/A /* if we're already out of memory, does strdup just return NULL? */ 1N/A /* do the actual conversion this time */ 1N/A#
endif /* HAVE_LIBICU */