home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / libi18n / csnametb.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  9.0 KB  |  257 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /*    csnametb.c    */
  19.  
  20. #include "intlpriv.h"
  21.  
  22. /* Charset names and aliases from RFC 1700. Also encloded equivelend Java encoding names. Names are case
  23.  * insenstive. Currently searches table linearly, so keep commonly used names at the beginning.
  24.  */
  25. MODULE_PRIVATE csname2id_t csname2id_tbl[] = {
  26.                                             /* default if not specified */
  27.             {"x-default", "", CS_DEFAULT},            /* or unknown charset        */
  28.  
  29.             {"us-ascii", "8859_1", CS_ASCII},
  30.             {"iso-8859-1", "8859_1", CS_LATIN1},
  31.             {"iso-2022-jp", "JIS", CS_JIS},
  32.             {"iso-2022-jp-2", "JIS", CS_JIS},        /* treat same as iso-2022-jp*/
  33.             {"Shift_JIS", "SJIS", CS_SJIS},
  34.             {"euc-jp", "EUC", CS_EUCJP},
  35.             {"jis_x0208-1983", "JIS0208", CS_JISX0208},
  36.             {"x-jisx0208-11", "JIS0208", CS_JISX0208_11},
  37.             {"jis_x0201", "JIS0208", CS_JISX0201},
  38.             {"jis_x0212-1990", "JIS0208", CS_JISX0212},
  39.             {"x-mac-roman", "MacRoman", CS_MAC_ROMAN}, 
  40.             {"iso-8859-2", "8859_2", CS_LATIN2},
  41.             {"iso-8859-3", "8859_3", CS_8859_3},
  42.             {"iso-8859-4", "8859_4", CS_8859_4},
  43.             {"iso-8859-5", "8859_5", CS_8859_5},
  44.             {"iso-8859-6", "8859_6", CS_8859_6},
  45.             {"iso-8859-7", "8859_7", CS_8859_7},
  46.             {"iso-8859-8", "8859_8", CS_8859_8},
  47.             {"iso-8859-9", "8859_9", CS_8859_9},
  48.             {"x-mac-ce", "MacCentralEurope", CS_MAC_CE},
  49.             {"EUC-KR", "KSC5601", CS_KSC_8BIT},    /* change to UPPER case per Jungshik Shin <jshin@pantheon.yale.edu> request to work around Korean SendMail Decode bug */
  50.             {"ks_c_5601-1987", "KSC5601", CS_KSC5601},
  51.             {"x-ksc5601-11", "KSC5601", CS_KSC5601_11},
  52.             {"gb2312", "GB2312", CS_GB_8BIT},
  53.             {"gb_2312-80", "GB2312", CS_GB2312},
  54.             {"x-gb2312-11", "GB2312", CS_GB2312_11},
  55.             {"x-euc-tw", "", CS_CNS_8BIT},
  56.             {"x-cns11643-1", "CNS11643", CS_CNS11643_1},
  57.             {"x-cns11643-2", "CNS11643", CS_CNS11643_2},
  58.             {"x-cns11643-1110", "CNS11643", CS_CNS11643_1110},
  59.             {"iso-2022-kr", "KR2022", CS_2022_KR},
  60.             {"big5", "Big5", CS_BIG5},
  61.             {"x-x-big5", "Big5", CS_X_BIG5},
  62.             {"x-tis620", "TIS620", CS_TIS620},
  63.             {"adobe-symbol-encoding", "Symbol", CS_SYMBOL},
  64.             {"x-dingbats", "DingBats", CS_DINGBATS},
  65.             {"x-dectech", "DECTECH", CS_DECTECH},
  66.             {"koi8-r", "KOI8", CS_KOI8_R},
  67.             {"x-mac-cyrillic", "MacCyrillic", CS_MAC_CYRILLIC}, 
  68.             {"x-mac-greek", "MacGreek", CS_MAC_GREEK}, 
  69.             {"x-mac-turkish", "MacTurkish", CS_MAC_TURKISH}, 
  70.             {"windows-1250", "Cp1250", CS_CP_1250},
  71.             {"windows-1251", "Cp1251", CS_CP_1251}, /* cyrillic */
  72.             {"windows-1253", "Cp1253", CS_CP_1253},  /* greek */
  73.             {"UTF-8", "UTF8", CS_UTF8},
  74.             {"UTF-7", "UTF7", CS_UTF7},
  75.             {"ISO-10646-UCS-2", "UCS2", CS_UCS2},
  76.             {"ISO-10646-UCS-4", "UCS4", CS_UCS4},
  77.             {"x-imap4-modified-utf7", "", CS_IMAP4_UTF7},
  78.  
  79. #ifdef XP_OS2
  80.     /* Additional OS/2 codepages. These are IANA primary names */
  81.             {"ibm850", "Cp850", CS_CP_850},         /* PC Latin 1 */
  82.             {"ibm852", "Cp852", CS_CP_852},         /* PC Latin 2 */
  83.             {"ibm855", "Cp855", CS_CP_855},         /* PC Cyrillic */
  84.             {"ibm857", "Cp857", CS_CP_857},         /* PC Turkish */
  85.             {"ibm862", "Cp862", CS_CP_862},         /* PC Hebrew */
  86.             {"ibm864", "Cp864", CS_CP_864},         /* PC Arabic */
  87.             {"ibm866", "Cp866", CS_CP_866},         /* PC Russian */
  88.             {"ibm874", "Cp874", CS_CP_874},         /* PC Thai */
  89.             {"windows-1257", "Cp1257", CS_CP_1257}, /* Windows Baltic */
  90.  
  91.     /* OS/2 IANA alias entries */
  92.             {"cp850", "", CS_CP_850},               /* PC Latin 1 */
  93.             {"cp852", "", CS_CP_852},               /* PC Latin 2 */
  94.             {"cp857", "", CS_CP_857},               /* PC Turkish */
  95.             {"cp862", "", CS_CP_862},               /* PC Hebrew */
  96.             {"cp864", "", CS_CP_864},               /* PC Arabic */
  97.             {"cp874", "", CS_CP_874},               /* PC Thai */
  98. #endif
  99.  
  100.     /* aliases for us-ascii: */
  101.             {"ansi_x3.4-1968", "", CS_ASCII},
  102.             {"iso-ir-6", "", CS_ASCII},
  103.             {"ansi_x3.4-1986", "", CS_ASCII},
  104.             {"iso_646.irv:1991", "", CS_ASCII},
  105.             {"ascii", "", CS_ASCII},
  106.             {"iso646-us", "", CS_ASCII},
  107.             {"us", "", CS_ASCII},
  108.             {"ibm367", "", CS_ASCII},
  109.             {"cp367", "", CS_ASCII},
  110.             {"csASCII", "", CS_ASCII},
  111.  
  112.     /* aliases for iso_8859-1:    */
  113.             {"latin1", "", CS_LATIN1},
  114.             {"iso_8859-1", "", CS_LATIN1},
  115.             {"iso_8859-1:1987", "", CS_LATIN1},
  116.             {"iso-ir-100", "", CS_LATIN1},
  117.             {"l1", "", CS_LATIN1},
  118.             {"ibm819", "", CS_LATIN1},
  119.             {"cp819", "", CS_LATIN1},
  120.             {"ISO-8859-1-Windows-3.0-Latin-1", "", CS_LATIN1},
  121.             {"ISO-8859-1-Windows-3.1-Latin-1", "", CS_LATIN1},
  122. #ifdef XP_OS2
  123.             {"windows-1252", "Cp1252", CS_LATIN1},
  124. #endif            
  125.             
  126.     /* aliases for ISO_8859-2:    */
  127.             {"latin2", "", CS_LATIN2},            
  128.             {"iso_8859-2", "", CS_LATIN2},
  129.             {"iso_8859-2:1987", "", CS_LATIN2},
  130.             {"iso-ir-101", "", CS_LATIN2},
  131.             {"l2", "", CS_LATIN2},                                            
  132.             {"ISO-8859-2-Windows-Latin-2", "", CS_LATIN2},
  133.  
  134.     /* aliases for KS_C_5601-1987:    */
  135.             {"ks_c_5601-1987", "", CS_KSC5601},
  136.             {"iso-ir-149", "", CS_KSC5601},
  137.             {"ks_c_5601-1989", "", CS_KSC5601},
  138.             {"ksc_5601", "", CS_KSC5601},
  139.             {"ks_c_5601", "", CS_KSC5601},
  140.             {"korean", "", CS_KSC5601},
  141.             {"csKSC56011987", "", CS_KSC5601},
  142.  
  143.     /* aliases for iso-2022-kr:    */
  144.             {"csISO2022KR", "", CS_2022_KR},
  145.  
  146.     /* aliases for euc-kr:    */
  147.             {"csEUCKR", "", CS_KSC_8BIT},
  148.  
  149.     /* aliases for iso-2022-jp:    */
  150.             {"csISO2022JP", "", CS_JIS},
  151.  
  152.     /* aliases for iso-2022-jp-2:    */
  153.             {"csISO2022JP2", "", CS_JIS},
  154.  
  155.     /* aliases for GB_2312-80:    */
  156.             {"iso-ir-58", "", CS_GB2312},
  157.             {"chinese", "", CS_GB2312},
  158.             {"csISO58GB231280", "", CS_GB2312},
  159.  
  160.     /* aliases for gb2312:    */
  161.             {"csGB2312", "", CS_GB_8BIT},
  162.             {"CN-GB", "", CS_GB_8BIT},  /* Simplified Chinese */
  163.             {"CN-GB-ISOIR165", "", CS_GB_8BIT},  /* Simplified Chinese */
  164.  
  165.     /* aliases for big5:    */
  166.             {"csBig5", "", CS_BIG5},
  167.             {"CN-Big5", "", CS_BIG5},  /* Traditional Chinese */
  168.  
  169.     /* aliases for iso-8859-7:    */
  170.             {"iso-ir-126", "", CS_8859_7},
  171.             {"iso_8859-7", "", CS_8859_7},
  172.             {"iso_8859-7:1987", "", CS_8859_7},
  173.             {"elot_928", "", CS_8859_7},
  174.             {"ecma-118", "", CS_8859_7},
  175.             {"greek", "", CS_8859_7},
  176.             {"greek8", "", CS_8859_7},
  177.             {"csISOLatinGreek", "", CS_8859_7},
  178.  
  179.     /* aliases for iso-8859-5:    */
  180.             {"iso-ir-144", "", CS_8859_5},
  181.             {"iso_8859-5", "", CS_8859_5},
  182.             {"iso_8859-5:1988", "", CS_8859_5},
  183.             {"cyrillic", "", CS_8859_5},
  184.             {"csISOLatinCyrillic", "", CS_8859_5},
  185.  
  186.     /* aliases for jis_x0212-1990:    */
  187.             {"x0212", "", CS_JISX0212},
  188.             {"iso-ir-159", "", CS_JISX0212},
  189.             {"csISO159JISX02121990", "", CS_JISX0212},
  190.  
  191.     /* aliases for jis_x0201:    */
  192.             {"x0201", "", CS_JISX0201},
  193.             {"csHalfWidthKatakana", "", CS_JISX0201},
  194.  
  195.     /* aliases for koi8-r:    */
  196.             {"csKOI8R", "", CS_KOI8_R},
  197.  
  198.     /* aliases for Shift_JIS:    */
  199.             {"x-sjis", "", CS_SJIS},
  200.             {"ms_Kanji", "", CS_SJIS},
  201.             {"csShiftJIS", "", CS_SJIS},
  202.             {"Windows-31J", "", CS_SJIS},
  203.  
  204.     /* aliases for x-euc-jp:    */
  205.             {"Extended_UNIX_Code_Packed_Format_for_Japanese", "", CS_EUCJP},
  206.             {"csEUCPkdFmtJapanese", "", CS_EUCJP},
  207.             {"x-euc-jp", "", CS_EUCJP},
  208.  
  209.     /* aliases for adobe-symbol-encoding:    */
  210.             {"csHPPSMath", "", CS_SYMBOL},
  211.  
  212.     /* aliases for iso-8859-5-windows-latin-5:    */
  213.             {"csWindows31Latin5", "", CS_CP_1251},
  214.             {"iso-8859-5-windows-latin-5", "", CS_CP_1251},
  215.             {"x-cp1251", "", CS_CP_1251},
  216.  
  217.     /* aliases for windows-1250:    */
  218.             {"x-cp1250", "", CS_CP_1250},
  219.  
  220.     /* aliases for windows-1253:    */
  221.             {"x-cp1253", "", CS_CP_1253}, 
  222.  
  223.     /* aliases for windows-1254:    */
  224.             {"windows-1254", "", CS_8859_9},  /* turkish */
  225.  
  226.     /* aliases for UNICODE-1-1:    */
  227. #ifdef XP_OS2
  228.             {"csUnicode", "", CS_UCS2},
  229. #endif      
  230.             {"csUnicode11", "", CS_UCS2},
  231.             {"ISO-10646-UCS-BASIC", "", CS_UCS2},
  232.             {"csUnicodeASCII", "", CS_UCS2},
  233.             {"ISO-10646-Unicode-Latin1", "", CS_UCS2},
  234.             {"csUnicodeLatin1", "", CS_UCS2},
  235.             {"ISO-10646", "", CS_UCS2},
  236.             {"ISO-10646-J-1", "", CS_UCS2},
  237.  
  238.     /* aliases for UNICODE-1-1-UTF-7:    */
  239.             {"x-UNICODE-2-0-UTF-7", "", CS_UTF7},            /* This is not in INAN */
  240.             {"UNICODE-1-1-UTF-7", "", CS_UTF7},
  241.             {"UNICODE-2-0-UTF-7", "", CS_UTF7},    /* Appeared in UTF-7 RFC Draft */
  242.             {"csUnicode11UTF7", "", CS_UTF7},
  243.  
  244.     /* aliases for UNICODE-1-1-UTF-8:    */
  245.             {"UNICODE-1-1-UTF-8", "", CS_UTF8},
  246.  
  247.             {"x-user-defined", "", CS_USER_DEFINED_ENCODING},                                            
  248.             {"x-user-defined", "", CS_USRDEF2},                                            
  249.  
  250.             {"RESERVED", "", CS_DEFAULT},            /* or unknown charset        */
  251.  
  252.             {"",     "", CS_UNKNOWN}
  253. };
  254.  
  255.  
  256.  
  257.