]> git.eshelyaron.com Git - emacs.git/commitdiff
Tighten recently-added UTF-8 check
authorPaul Eggert <eggert@Penguin.CS.UCLA.EDU>
Mon, 17 Apr 2017 17:19:39 +0000 (10:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Apr 2017 17:20:39 +0000 (10:20 -0700)
* src/coding.c (encode_coding_utf_8): Now extern.
* src/terminal.c (terminal_glyph_code) [HAVE_STRUCT_UNIPAIR_UNICODE]:
Check for UTF-8, not just for multibyte.

src/coding.c
src/coding.h
src/terminal.c

index e341a71f576e9fc7b6595de769345990a7e5aea2..367a9759848f84bd98b36232af665913f979fdd9 100644 (file)
@@ -1449,7 +1449,7 @@ decode_coding_utf_8 (struct coding_system *coding)
 }
 
 
-static bool
+bool
 encode_coding_utf_8 (struct coding_system *coding)
 {
   bool multibytep = coding->dst_multibyte;
index 77f90ec9c150e9a2c5a3bdee79921e97e12951eb..8ed851d99ff68cd0d34af0441b53ce1ebffa7a8e 100644 (file)
@@ -664,6 +664,7 @@ struct coding_system
 
 /* Extern declarations.  */
 extern Lisp_Object code_conversion_save (bool, bool);
+extern bool encode_coding_utf_8 (struct coding_system *);
 extern void setup_coding_system (Lisp_Object, struct coding_system *);
 extern Lisp_Object coding_charset_list (struct coding_system *);
 extern Lisp_Object coding_system_charset_list (Lisp_Object);
index 3d25b36fa565e661f437d2fbd212a9139b286504..367f2ac7192c38550dec05edbd3aaede71f21ce0 100644 (file)
@@ -576,8 +576,9 @@ terminal_glyph_code (struct terminal *t, int ch)
 {
 #if HAVE_STRUCT_UNIPAIR_UNICODE
   /* Heuristically assume that a terminal supporting glyph codes is in
-     UTF-8 mode if and only if its coding system is multibyte (Bug#26396).  */
-  if (t->type == output_termcap && t->terminal_coding->src_multibyte)
+     UTF-8 mode if and only if its coding system is UTF-8 (Bug#26396).  */
+  if (t->type == output_termcap
+      && t->terminal_coding->encoder == encode_coding_utf_8)
     {
       /* As a hack, recompute the table when CH is the maximum
         character.  */