comparison src/unicode.c @ 2704:114400ea911b

[xemacs-hg @ 2005-03-31 14:56:37 by aidan] Fix Unicode conversion for control-1, prevent a segfault with set-unicode-conversion.
author aidan
date Thu, 31 Mar 2005 14:56:48 +0000
parents c8a9be2d4728
children 6fa9919a9a0b
comparison
equal deleted inserted replaced
2703:2f2d12f4f93a 2704:114400ea911b
855 855
856 #ifdef SLEDGEHAMMER_CHECK_UNICODE 856 #ifdef SLEDGEHAMMER_CHECK_UNICODE
857 sledgehammer_check_unicode_tables (charset); 857 sledgehammer_check_unicode_tables (charset);
858 #endif 858 #endif
859 859
860 if (EQ(charset, Vcharset_ascii) || EQ(charset, Vcharset_control_1))
861 return;
862
860 /* First, the char -> unicode translation */ 863 /* First, the char -> unicode translation */
861 864
862 if (XCHARSET_DIMENSION (charset) == 1) 865 if (XCHARSET_DIMENSION (charset) == 1)
863 { 866 {
864 int *to_table = (int *) XCHARSET_TO_UNICODE_TABLE (charset); 867 int *to_table = (int *) XCHARSET_TO_UNICODE_TABLE (charset);
1919 } 1922 }
1920 else 1923 else
1921 { /* Processing Non-ASCII character */ 1924 { /* Processing Non-ASCII character */
1922 char_boundary = 1; 1925 char_boundary = 1;
1923 if (EQ (charset, Vcharset_control_1)) 1926 if (EQ (charset, Vcharset_control_1))
1924 encode_unicode_char (Vcharset_control_1, c, 0, dst, 1927 /* See:
1928
1929 (Info-goto-node "(internals)Internal String Encoding")
1930
1931 for the rationale behind subtracting #xa0 from the
1932 character's code. */
1933 encode_unicode_char (Vcharset_control_1, c - 0xa0, 0, dst,
1925 type, little_endian); 1934 type, little_endian);
1926 else 1935 else
1927 { 1936 {
1928 switch (XCHARSET_REP_BYTES (charset)) 1937 switch (XCHARSET_REP_BYTES (charset))
1929 { 1938 {