User: aidan   
  Date: 05/03/31 16:57:03
  Modified:    xemacs/src ChangeLog unicode.c
  Log:
  Fix Unicode conversion for control-1, prevent a segfault with
  set-unicode-conversion.
  
  Revision  Changes    Path
  1.819     +10 -0     XEmacs/xemacs/src/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
  retrieving revision 1.818
  retrieving revision 1.819
  diff -u -p -r1.818 -r1.819
  --- ChangeLog	2005/03/29 02:59:13	1.818
  +++ ChangeLog	2005/03/31 14:56:37	1.819
  @@ -1,3 +1,13 @@
  +2005-03-31  Aidan Kehoe  <kehoea(a)parhasard.net>
  +
  +	* unicode.c (set_unicode_conversion): Don't try to write to the
  +	non-existent conversion tables for ASCII and control-1, in the
  +	interest of not segfaulting. 
  +	* unicode.c (unicode_convert): The "position code" for a control-1
  +	character has #xA0 added to it when encoded in Mule, unlike #x80
  +	for all the other non-ASCII character sets ; take this into
  +	account.
  +
   2005-03-29  Aidan Kehoe  <kehoea(a)parhasard.net>
   
   	* event-Xt.c: Declare Funicode_to_char. 
  
  
  
  1.27      +10 -1     XEmacs/xemacs/src/unicode.c
  
  Index: unicode.c
  ===================================================================
  RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unicode.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -p -r1.26 -r1.27
  --- unicode.c	2005/02/28 23:36:32	1.26
  +++ unicode.c	2005/03/31 14:56:48	1.27
  @@ -857,6 +857,9 @@ set_unicode_conversion (Ichar chr, int c
     sledgehammer_check_unicode_tables (charset);
   #endif
   
  +  if (EQ(charset, Vcharset_ascii) || EQ(charset, Vcharset_control_1))
  +    return;
  +
     /* First, the char -> unicode translation */
   
     if (XCHARSET_DIMENSION (charset) == 1)
  @@ -1921,7 +1924,13 @@ unicode_convert (struct coding_stream *s
   	    {			/* Processing Non-ASCII character */
   	      char_boundary = 1;
   	      if (EQ (charset, Vcharset_control_1))
  -		encode_unicode_char (Vcharset_control_1, c, 0, dst,
  +		/* See:
  +
  +		   (Info-goto-node "(internals)Internal String Encoding")
  +
  +		   for the rationale behind subtracting #xa0 from the
  +		   character's code. */
  +		encode_unicode_char (Vcharset_control_1, c - 0xa0, 0, dst,
   				     type, little_endian);
   	      else
   		{
  
  
  
    
    
    
 
                    
                    
                        
                        Show replies by date