comparison src/unicode.c @ 4990:8f0cf4fd3d2c

Automatic merge
author Ben Wing <ben@xemacs.org>
date Sat, 06 Feb 2010 04:01:46 -0600
parents 16112448d484
children 1fae11d56ad2
comparison
equal deleted inserted replaced
4989:d2ec55325515 4990:8f0cf4fd3d2c
506 } 506 }
507 break; 507 break;
508 } 508 }
509 } 509 }
510 510
511 xfree (table, void *); 511 xfree (table);
512 } 512 }
513 513
514 static void 514 static void
515 free_to_unicode_table (void *table, int level) 515 free_to_unicode_table (void *table, int level)
516 { 516 {
524 if (tab[i] != to_unicode_blank_1) 524 if (tab[i] != to_unicode_blank_1)
525 free_to_unicode_table (tab[i], 1); 525 free_to_unicode_table (tab[i], 1);
526 } 526 }
527 } 527 }
528 528
529 xfree (table, void *); 529 xfree (table);
530 } 530 }
531 531
532 void 532 void
533 free_charset_unicode_tables (Lisp_Object charset) 533 free_charset_unicode_tables (Lisp_Object charset)
534 { 534 {
1153 assert(100 > number_of_jit_charsets); 1153 assert(100 > number_of_jit_charsets);
1154 1154
1155 qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets); 1155 qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets);
1156 1156
1157 Vcurrent_jit_charset = Fmake_charset 1157 Vcurrent_jit_charset = Fmake_charset
1158 (intern((const CIbyte *)setname), Vcharset_descr, 1158 (intern_istring (setname), Vcharset_descr,
1159 /* Set encode-as-utf-8 to t, to have this character set written 1159 /* Set encode-as-utf-8 to t, to have this character set written
1160 using UTF-8 escapes in escape-quoted and ctext. This 1160 using UTF-8 escapes in escape-quoted and ctext. This
1161 sidesteps the fact that our internal character -> Unicode 1161 sidesteps the fact that our internal character -> Unicode
1162 mapping is not stable from one invocation to the next. */ 1162 mapping is not stable from one invocation to the next. */
1163 nconc2 (list2(Qencode_as_utf_8, Qt), 1163 nconc2 (list2(Qencode_as_utf_8, Qt),
2824 int UNUSED (escapeflag)) 2824 int UNUSED (escapeflag))
2825 { 2825 {
2826 write_fmt_string_lisp (printcharfun, "(%s", 1, 2826 write_fmt_string_lisp (printcharfun, "(%s", 1,
2827 unicode_getprop (cs, Qunicode_type)); 2827 unicode_getprop (cs, Qunicode_type));
2828 if (XCODING_SYSTEM_UNICODE_LITTLE_ENDIAN (cs)) 2828 if (XCODING_SYSTEM_UNICODE_LITTLE_ENDIAN (cs))
2829 write_c_string (printcharfun, ", little-endian"); 2829 write_ascstring (printcharfun, ", little-endian");
2830 if (XCODING_SYSTEM_UNICODE_NEED_BOM (cs)) 2830 if (XCODING_SYSTEM_UNICODE_NEED_BOM (cs))
2831 write_c_string (printcharfun, ", need-bom"); 2831 write_ascstring (printcharfun, ", need-bom");
2832 write_c_string (printcharfun, ")"); 2832 write_ascstring (printcharfun, ")");
2833 } 2833 }
2834 2834
2835 #ifdef MULE 2835 #ifdef MULE
2836 DEFUN ("set-unicode-query-skip-chars-args", Fset_unicode_query_skip_chars_args, 2836 DEFUN ("set-unicode-query-skip-chars-args", Fset_unicode_query_skip_chars_args,
2837 3, 3, 0, /* 2837 3, 3, 0, /*
3046 assert (previous_failed_reason == query_coding_invalid_sequence 3046 assert (previous_failed_reason == query_coding_invalid_sequence
3047 || previous_failed_reason == query_coding_unencodable); 3047 || previous_failed_reason == query_coding_unencodable);
3048 3048
3049 if (flags & QUERY_METHOD_ERRORP) 3049 if (flags & QUERY_METHOD_ERRORP)
3050 { 3050 {
3051 DECLARE_EISTRING (error_details); 3051 signal_error_2
3052 3052 (Qtext_conversion_error,
3053 eicpy_ascii (error_details, "Cannot encode "); 3053 "Cannot encode using coding system",
3054 eicat_lstr (error_details, 3054 make_string_from_buffer (buf, fail_range_start,
3055 make_string_from_buffer (buf, fail_range_start, 3055 pos - fail_range_start),
3056 pos - 3056 XCODING_SYSTEM_NAME (codesys));
3057 fail_range_start));
3058 eicat_ascii (error_details, " using coding system");
3059
3060 signal_error (Qtext_conversion_error,
3061 (const CIbyte *)(eidata (error_details)),
3062 XCODING_SYSTEM_NAME (codesys));
3063 } 3057 }
3064 3058
3065 if (NILP (result)) 3059 if (NILP (result))
3066 { 3060 {
3067 result = Fmake_range_table (Qstart_closed_end_open); 3061 result = Fmake_range_table (Qstart_closed_end_open);
3217 Vnumber_of_jit_charsets = make_int (0); 3211 Vnumber_of_jit_charsets = make_int (0);
3218 staticpro (&Vlast_jit_charset_final); 3212 staticpro (&Vlast_jit_charset_final);
3219 Vlast_jit_charset_final = make_char (0x30); 3213 Vlast_jit_charset_final = make_char (0x30);
3220 staticpro (&Vcharset_descr); 3214 staticpro (&Vcharset_descr);
3221 Vcharset_descr 3215 Vcharset_descr
3222 = build_string ("Mule charset for otherwise unknown Unicode code points."); 3216 = build_defer_string ("Mule charset for otherwise unknown Unicode code points.");
3223 3217
3224 staticpro (&Vlanguage_unicode_precedence_list); 3218 staticpro (&Vlanguage_unicode_precedence_list);
3225 Vlanguage_unicode_precedence_list = Qnil; 3219 Vlanguage_unicode_precedence_list = Qnil;
3226 3220
3227 staticpro (&Vdefault_unicode_precedence_list); 3221 staticpro (&Vdefault_unicode_precedence_list);
3266 displaying charsets for which the `encode-as-utf-8' property is true, and 3260 displaying charsets for which the `encode-as-utf-8' property is true, and
3267 those used when no font matching the charset's registries property has been 3261 those used when no font matching the charset's registries property has been
3268 found (that is, they're probably Mule-specific charsets like Ethiopic or 3262 found (that is, they're probably Mule-specific charsets like Ethiopic or
3269 IPA.) 3263 IPA.)
3270 */ ); 3264 */ );
3271 Qunicode_registries = vector1(build_string("iso10646-1")); 3265 Qunicode_registries = vector1(build_ascstring("iso10646-1"));
3272 3266
3273 /* Initialised in lisp/mule/general-late.el, by a call to 3267 /* Initialised in lisp/mule/general-late.el, by a call to
3274 #'set-unicode-query-skip-chars-args. Or at least they would be, but we 3268 #'set-unicode-query-skip-chars-args. Or at least they would be, but we
3275 can't do this at dump time right now, initialised range tables aren't 3269 can't do this at dump time right now, initialised range tables aren't
3276 dumped properly. */ 3270 dumped properly. */
3296 { 3290 {
3297 /* We used to define this in unicode.el. But we need it early for 3291 /* We used to define this in unicode.el. But we need it early for
3298 Cygwin 1.7 -- used in LOCAL_FILE_FORMAT_TO_TSTR() et al. */ 3292 Cygwin 1.7 -- used in LOCAL_FILE_FORMAT_TO_TSTR() et al. */
3299 Fmake_coding_system_internal 3293 Fmake_coding_system_internal
3300 (Qutf_8, Qunicode, 3294 (Qutf_8, Qunicode,
3301 build_msg_string ("UTF-8"), 3295 build_defer_string ("UTF-8"),
3302 nconc2 (list4 (Qdocumentation, 3296 nconc2 (list4 (Qdocumentation,
3303 build_msg_string ( 3297 build_defer_string (
3304 "UTF-8 Unicode encoding -- ASCII-compatible 8-bit variable-width encoding\n" 3298 "UTF-8 Unicode encoding -- ASCII-compatible 8-bit variable-width encoding\n"
3305 "sharing the following principles with the Mule-internal encoding:\n" 3299 "sharing the following principles with the Mule-internal encoding:\n"
3306 "\n" 3300 "\n"
3307 " -- All ASCII characters (codepoints 0 through 127) are represented\n" 3301 " -- All ASCII characters (codepoints 0 through 127) are represented\n"
3308 " by themselves (i.e. using one byte, with the same value as the\n" 3302 " by themselves (i.e. using one byte, with the same value as the\n"
3320 " character are disjoint, so moving backwards is easy.\n" 3314 " character are disjoint, so moving backwards is easy.\n"
3321 "\n" 3315 "\n"
3322 " -- Given only the leading byte, you know how many following bytes\n" 3316 " -- Given only the leading byte, you know how many following bytes\n"
3323 " are present.\n" 3317 " are present.\n"
3324 ), 3318 ),
3325 Qmnemonic, build_string ("UTF8")), 3319 Qmnemonic, build_ascstring ("UTF8")),
3326 list2 (Qunicode_type, Qutf_8))); 3320 list2 (Qunicode_type, Qutf_8)));
3327 } 3321 }