Mercurial > hg > xemacs-beta
comparison src/file-coding.c @ 3413:e13aec8357bb
[xemacs-hg @ 2006-05-22 20:27:57 by aidan]
Prevent a crash with a debug XEmacs and mule.
author | aidan |
---|---|
date | Mon, 22 May 2006 20:28:01 +0000 |
parents | 3d54e5f2dfb0 |
children | a9bb932a03b5 |
comparison
equal
deleted
inserted
replaced
3412:88b62bce19cf | 3413:e13aec8357bb |
---|---|
3368 output_bytes_in_ascii_and_hex (const UExtbyte *src, Bytecount n) | 3368 output_bytes_in_ascii_and_hex (const UExtbyte *src, Bytecount n) |
3369 { | 3369 { |
3370 UExtbyte *ascii = alloca_array (UExtbyte, n + 1); | 3370 UExtbyte *ascii = alloca_array (UExtbyte, n + 1); |
3371 UExtbyte *hex = alloca_array (UExtbyte, 3 * n + 1); | 3371 UExtbyte *hex = alloca_array (UExtbyte, 3 * n + 1); |
3372 int i; | 3372 int i; |
3373 DECLARE_EISTRING (eistr_ascii); | |
3374 DECLARE_EISTRING (eistr_hex); | |
3373 | 3375 |
3374 for (i = 0; i < n; i++) | 3376 for (i = 0; i < n; i++) |
3375 { | 3377 { |
3376 UExtbyte c = src[i]; | 3378 UExtbyte c = src[i]; |
3377 if (c < 0x20) | 3379 if (c < 0x20) |
3382 hex[3 * i + 1] = hex_digit_to_char (c & 0xF); | 3384 hex[3 * i + 1] = hex_digit_to_char (c & 0xF); |
3383 hex[3 * i + 2] = ' '; | 3385 hex[3 * i + 2] = ' '; |
3384 } | 3386 } |
3385 ascii[i] = '\0'; | 3387 ascii[i] = '\0'; |
3386 hex[3 * i - 1] = '\0'; | 3388 hex[3 * i - 1] = '\0'; |
3387 stderr_out ("%s %s", ascii, hex); | 3389 |
3390 eicpy_ext(eistr_hex, hex, Qbinary); | |
3391 eicpy_ext(eistr_ascii, ascii, Qbinary); | |
3392 | |
3393 stderr_out ("%s %s", eidata(eistr_ascii), eidata(eistr_hex)); | |
3388 } | 3394 } |
3389 | 3395 |
3390 #endif /* DEBUG_XEMACS */ | 3396 #endif /* DEBUG_XEMACS */ |
3391 | 3397 |
3392 /* Attempt to determine the encoding of the given text. Before calling | 3398 /* Attempt to determine the encoding of the given text. Before calling |