summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xselect.c7
1 files changed, 6 insertions, 1 deletions
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;