--- rxvt-unicode/src/encoding.C 2004/03/10 18:42:58 1.9 +++ rxvt-unicode/src/encoding.C 2004/04/08 20:31:45 1.16 @@ -1,3 +1,25 @@ +/*--------------------------------*-C-*---------------------------------* + * File: encoding.C + *----------------------------------------------------------------------* + * + * All portions of code are copyright by their respective author/s. + * Copyright (c) 2003-2004 Marc Lehmann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *----------------------------------------------------------------------*/ + #include "../config.h" #include "encoding.h" @@ -46,9 +68,11 @@ { "VISCII*", CS_VISCII }, { "JISX0201*", CS_JIS0201_1976_0 }, - { "JISX0208*", CS_JIS0208_1983_0 }, // also wrongly matches -1990-0 (check Encode::JP) + { "JISX0208*", CS_JIS0208_1990_0 }, // also wrongly matches -1987-0? (check Encode::JP) { "JISX0212*", CS_JIS0212_1990_0 }, - { "JISX0221*", CS_UNICODE }, + { "JISX021320001", CS_JIS0213_1 }, + { "JISX021320002", CS_JIS0213_2 }, + { "JISX0221*", CS_UNICODE }, // _very_ close { "KSC5601*", CS_KSC5601_1987_0 }, { "KSX1001*", CS_KSC5601_1987_0 }, @@ -115,12 +139,12 @@ } struct rxvt_codeset_conv_unknown : rxvt_codeset_conv { - uint32_t to_unicode (uint32_t enc) const { return NOCHAR; } - uint32_t from_unicode (uint32_t unicode) const { return NOCHAR; } + unicode_t to_unicode (uint32_t enc) const { return NOCHAR; } + uint32_t from_unicode (unicode_t unicode) const { return NOCHAR; } } rxvt_codeset_conv_unknown; struct rxvt_codeset_conv_us_ascii : rxvt_codeset_conv { - uint32_t from_unicode (uint32_t unicode) const { return unicode <= 127 ? unicode : NOCHAR; } + uint32_t from_unicode (unicode_t unicode) const { return unicode <= 127 ? unicode : NOCHAR; } } rxvt_codeset_conv_us_ascii; struct rxvt_codeset_conv_unicode : rxvt_codeset_conv { @@ -128,8 +152,8 @@ } rxvt_codeset_conv_unicode; struct rxvt_codeset_conv_unicode_16 : rxvt_codeset_conv { - uint32_t to_unicode (uint32_t enc) const { return enc; } - uint32_t from_unicode (uint32_t unicode) const { return unicode <= 65535 ? unicode : NOCHAR; } + unicode_t to_unicode (uint32_t enc) const { return enc; } + uint32_t from_unicode (unicode_t unicode) const { return unicode <= 65535 ? unicode : NOCHAR; } } rxvt_codeset_conv_unicode_16; #define ENCODING_DEFAULT @@ -185,7 +209,7 @@ //#define ENCODING_JP #include "table/jis0201_1976_0.h" -#include "table/jis0208_1983_0.h" +#include "table/jis0208_1990_0.h" #include "table/jis0212_1990_0.h" //#define ENCODING_JP_EXT @@ -219,7 +243,7 @@ &rxvt_codeset_conv_koi8_u, &rxvt_codeset_conv_jis0201_1976_0, - &rxvt_codeset_conv_jis0208_1983_0, + &rxvt_codeset_conv_jis0208_1990_0, &rxvt_codeset_conv_jis0212_1990_0, &rxvt_codeset_conv_jis0213_1, @@ -247,12 +271,14 @@ &rxvt_codeset_conv_unicode }; -//#define ENCODING_COMPOSE +#if ENABLE_COMBINING +# define ENCODING_COMPOSE +#endif #include "table/compose.h" -uint32_t -rxvt_compose (uint32_t c1, uint32_t c2) +unicode_t +rxvt_compose (unicode_t c1, unicode_t c2) { int l = 0; int r = sizeof (rxvt_compose_table) / sizeof (rxvt_compose_entry) - 1; @@ -273,3 +299,10 @@ return NOCHAR; } + +#include "table/category.h" + +bool unicode::is_space (unicode_t c) +{ + return IS_SPACE (c); +}