# HG changeset patch # User Kenichi Handa # Date 1108342782 0 # Node ID e41b38ec1a82a5963356229730f25f4e733fc351 # Parent 210af0ad3d35ff2896ee44b621ceb362c7b05516 (lisp_data_to_selection_data): If OBJ is a non-ASCII multibyte string, signal an error instead of aborting. diff -r 210af0ad3d35 -r e41b38ec1a82 src/xselect.c --- a/src/xselect.c Sun Feb 13 08:47:45 2005 +0000 +++ b/src/xselect.c Mon Feb 14 00:59:42 2005 +0000 @@ -1908,7 +1908,12 @@ } 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;