[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 932698b: Tighten recently-added UTF-8 check
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 932698b: Tighten recently-added UTF-8 check |
Date: |
Mon, 17 Apr 2017 13:20:44 -0400 (EDT) |
branch: master
commit 932698b7891668318ba9ca93375d8d27d52a07f5
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Tighten recently-added UTF-8 check
* 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 | 2 +-
src/coding.h | 1 +
src/terminal.c | 5 +++--
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/coding.c b/src/coding.c
index e341a71..367a975 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -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;
diff --git a/src/coding.h b/src/coding.h
index 77f90ec..8ed851d 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -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);
diff --git a/src/terminal.c b/src/terminal.c
index 3d25b36..367f2ac 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 932698b: Tighten recently-added UTF-8 check,
Paul Eggert <=