00001 /********************************************************************** 00002 cp932.c - Onigmo (Oniguruma-mod) (regular expression library) 00003 **********************************************************************/ 00004 /*- 00005 * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> 00006 * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp> 00007 * All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 2. Redistributions in binary form must reproduce the above copyright 00015 * notice, this list of conditions and the following disclaimer in the 00016 * documentation and/or other materials provided with the distribution. 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 00019 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00021 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00022 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00023 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00024 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00025 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00026 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00027 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00028 * SUCH DAMAGE. 00029 */ 00030 00031 #define ENC_CP932 00032 #include "shift_jis.c" 00033 00034 OnigEncodingDefine(windows_31j, Windows_31J) = { 00035 mbc_enc_len, 00036 "Windows-31J", /* name */ 00037 2, /* max byte length */ 00038 1, /* min byte length */ 00039 onigenc_is_mbc_newline_0x0a, 00040 mbc_to_code, 00041 code_to_mbclen, 00042 code_to_mbc, 00043 mbc_case_fold, 00044 apply_all_case_fold, 00045 get_case_fold_codes_by_str, 00046 property_name_to_ctype, 00047 is_code_ctype, 00048 get_ctype_code_range, 00049 left_adjust_char_head, 00050 is_allowed_reverse_match, 00051 0, 00052 ONIGENC_FLAG_NONE, 00053 }; 00054 /* 00055 * Name: Windows-31J 00056 * MIBenum: 2024 00057 * Link: http://www.iana.org/assignments/character-sets 00058 * Link: http://www.microsoft.com/globaldev/reference/dbcs/932.mspx 00059 * Link: http://ja.wikipedia.org/wiki/Windows-31J 00060 * Link: http://source.icu-project.org/repos/icu/data/trunk/charset/data/ucm/windows-932-2000.ucm 00061 * 00062 * Windows Standard Character Set and its mapping to Unicode by Microsoft. 00063 * Since 1.9.3, SJIS is the alias of Windows-31J because its character 00064 * set is usually this one even if its mapping may differ. 00065 */ 00066 ENC_ALIAS("CP932", "Windows-31J") 00067 ENC_ALIAS("csWindows31J", "Windows-31J") /* IANA. IE6 don't accept Windows-31J but csWindows31J. */ 00068 ENC_ALIAS("SJIS", "Windows-31J") 00069 00070 /* 00071 * Name: PCK 00072 * Link: http://download.oracle.com/docs/cd/E19253-01/819-0606/x-2chn0/index.html 00073 * Link: http://download.oracle.com/docs/cd/E19253-01/819-0606/appb-pckwarn-1/index.html 00074 * 00075 * Solaris's SJIS variant. Its set is Windows Standard Character Set; it 00076 * consists JIS X 0201 Latin (US-ASCII), JIS X 0201 Katakana, JIS X 0208, NEC 00077 * special characters, NEC-selected IBM extended characters, and IBM extended 00078 * characters. Solaris's iconv seems to use SJIS-open. 00079 */ 00080 ENC_ALIAS("PCK", "Windows-31J") 00081
1.4.7