X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ba13e6168a07a085c0ca8e67c91640b84ee0c1fd..8a28a5b8d8acb314d8850b85fe5cd956a86e8ff9:/src/charset.c diff --git a/src/charset.c b/src/charset.c index d8c38e5ea3..7c67ecb941 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1,5 +1,5 @@ /* Basic character set support. - Copyright (C) 2001-2012 Free Software Foundation, Inc. + Copyright (C) 2001-2013 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 National Institute of Advanced Industrial Science and Technology (AIST) @@ -421,7 +421,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries, /* Read a hexadecimal number (preceded by "0x") from the file FP while paying attention to comment character '#'. */ -static inline unsigned +static unsigned read_hex (FILE *fp, bool *eof, bool *overflow) { int c; @@ -1617,7 +1617,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) /* Return a unified character code for C (>= 0x110000). VAL is a value of Vchar_unify_table for C; i.e. it is nil, an integer, or a charset symbol. */ -int +static int maybe_unify_char (int c, Lisp_Object val) { struct charset *charset; @@ -1723,8 +1723,12 @@ decode_char (struct charset *charset, unsigned int code) { c = char_index + CHARSET_CODE_OFFSET (charset); if (CHARSET_UNIFIED_P (charset) - && c > MAX_UNICODE_CHAR) - MAYBE_UNIFY_CHAR (c); + && MAX_UNICODE_CHAR < c && c <= MAX_5_BYTE_CHAR) + { + /* Unify C with a Unicode character if possible. */ + Lisp_Object val = CHAR_TABLE_REF (Vchar_unify_table, c); + c = maybe_unify_char (c, val); + } } }