comparison src/term.c @ 111651:dbffbd2b89b9

Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display on a TTY. term.c (produce_glyphless_glyph): Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display of glyphless characters.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 20 Nov 2010 17:04:50 +0200
parents 107fd4b37e9d
children b9616a1b568d
comparison
equal deleted inserted replaced
111650:8fd0d7bcdf7d 111651:dbffbd2b89b9
1934 static void 1934 static void
1935 produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) 1935 produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1936 { 1936 {
1937 int face_id; 1937 int face_id;
1938 int len; 1938 int len;
1939 char buf[11], *str = " "; 1939 char buf[9], *str = " ";
1940 1940
1941 /* Get a face ID for the glyph by utilizing a cache (the same way as 1941 /* Get a face ID for the glyph by utilizing a cache (the same way as
1942 done for `escape-glyph' in get_next_display_element). */ 1942 done for `escape-glyph' in get_next_display_element). */
1943 if (it->f == last_glyphless_glyph_frame 1943 if (it->f == last_glyphless_glyph_frame
1944 && it->face_id == last_glyphless_glyph_face_id) 1944 && it->face_id == last_glyphless_glyph_face_id)
1985 len += 2; 1985 len += 2;
1986 } 1986 }
1987 else 1987 else
1988 { 1988 {
1989 xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE); 1989 xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
1990 len = (it->c < 0x100 ? sprintf (buf, "[U+%02X]", it->c) 1990 len = (it->c < 0x10000 ? sprintf (buf, "\\u%04X", it->c)
1991 : it->c < 0x10000 ? sprintf (buf, "[U+%04X]", it->c) 1991 : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "\\U%06X", it->c)
1992 : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "[U+%06X]", it->c) 1992 : sprintf (buf, "\\x%06X", it->c));
1993 : sprintf (buf, "[E+%06X]", it->c));
1994 } 1993 }
1995 str = buf; 1994 str = buf;
1996 } 1995 }
1997 1996
1998 it->pixel_width = len; 1997 it->pixel_width = len;