/[emacs]/emacs/src/character.c
ViewVC logotype

Diff of /emacs/src/character.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.15 by handa, Tue Aug 20 11:11:19 2002 UTC revision 1.1.2.16 by handa, Tue Sep 3 04:07:11 2002 UTC
# Line 81  Lisp_Object Vchar_script_table; Line 81  Lisp_Object Vchar_script_table;
81    
82  static Lisp_Object Qchar_script_table;  static Lisp_Object Qchar_script_table;
83    
84    /* Mapping table from unibyte chars to multibyte chars.  */
85    int unibyte_to_multibyte_table[256];
86    
87    
88    
# Line 179  translate_char (table, c) Line 181  translate_char (table, c)
181    return XINT (ch);    return XINT (ch);
182  }  }
183    
 /* Convert the unibyte character C to the corresponding multibyte  
    character based on the current value of charset_unibyte.  If C  
    can't be converted, return C.  */  
   
 int  
 unibyte_char_to_multibyte (c)  
      int c;  
 {  
   struct charset *charset = CHARSET_FROM_ID (charset_unibyte);  
   int c1 = DECODE_CHAR (charset, c);  
   
   return ((c1 >= 0) ? c1 : c);  
 }  
   
   
184  /* Convert the multibyte character C to unibyte 8-bit character based  /* Convert the multibyte character C to unibyte 8-bit character based
185     on the current value of charset_unibyte.  If dimension of     on the current value of charset_unibyte.  If dimension of
186     charset_unibyte is more than one, return (C & 0xFF).     charset_unibyte is more than one, return (C & 0xFF).
# Line 206  multibyte_char_to_unibyte (c, rev_tbl) Line 193  multibyte_char_to_unibyte (c, rev_tbl)
193       int c;       int c;
194       Lisp_Object rev_tbl;       Lisp_Object rev_tbl;
195  {  {
196    struct charset *charset = CHARSET_FROM_ID (charset_unibyte);    struct charset *charset;
197    unsigned c1 = ENCODE_CHAR (charset, c);    unsigned c1;
198    
199      if (CHAR_BYTE8_P (c))
200        return CHAR_TO_BYTE8 (c);
201      charset = CHARSET_FROM_ID (charset_unibyte);
202      c1 = ENCODE_CHAR (charset, c);
203    return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF);    return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF);
204  }  }
205    

Legend:
Removed from v.1.1.2.15  
changed lines
  Added in v.1.1.2.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26