From 1bd70c6e1d8bf8c2a02d68efd0fe8b4fa9bef60d Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 14 Feb 2005 00:59:42 +0000 Subject: [PATCH] (lisp_data_to_selection_data): If OBJ is a non-ASCII multibyte string, signal an error instead of aborting. --- src/xselect.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xselect.c b/src/xselect.c index bf37cde4d0b..8d8efd8db8a 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1908,7 +1908,12 @@ lisp_data_to_selection_data (display, obj, } else if (STRINGP (obj)) { - xassert (! STRING_MULTIBYTE (obj)); + if (SCHARS (obj) < SBYTES (obj)) + /* OBJ is a multibyte string containing a non-ASCII char. */ + Fsignal (Qerror, /* Qselection_error */ + Fcons (build_string + ("Non-ASCII string must be encoded in advance"), + Fcons (obj, Qnil))); if (NILP (type)) type = QSTRING; *format_ret = 8; -- 2.11.4.GIT