From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: Emacs puts binary junk into the clipboard, marking it as text Date: Tue, 19 Sep 2006 06:54:34 -0400 Message-ID: References: <1158280855.14121.69.camel@chrislap.madeupdomain.com> <450A514E.6020205@swipnet.se> <450BE084.10905@swipnet.se> <450C3380.2050008@swipnet.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1158663294 8573 80.91.229.2 (19 Sep 2006 10:54:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2006 10:54:54 +0000 (UTC) Cc: "Jan D." , emacs-pretest-bug@gnu.org, ihs_4664@yahoo.com, emacs-devel@gnu.org, richard.stallman@gnu.org, christopher.ian.moore@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 19 12:54:52 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GPdFa-0004gG-5O for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2006 12:54:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPdFZ-00082I-2R for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2006 06:54:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GPdFN-00080c-FB for emacs-devel@gnu.org; Tue, 19 Sep 2006 06:54:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GPdFM-0007zc-K2 for emacs-devel@gnu.org; Tue, 19 Sep 2006 06:54:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPdFM-0007zZ-Db; Tue, 19 Sep 2006 06:54:36 -0400 Original-Received: from [64.122.15.118] (helo=alfajor) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GPdIP-0007jf-C5; Tue, 19 Sep 2006 06:57:45 -0400 Original-Received: by alfajor (Postfix, from userid 20848) id D7D281C1B9; Tue, 19 Sep 2006 06:54:34 -0400 (EDT) Original-To: Kenichi Handa In-Reply-To: (Kenichi Handa's message of "Tue\, 19 Sep 2006 14\:05\:40 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60007 gmane.emacs.pretest.bugs:14000 Archived-At: >> I've checked in a fix that changes UTF8_STRING to STRING if the data >> doesn't look like UTF8. However, this might give errors too. The only >> way to be sure to copy raw binary data correctly is by adding a new type >> (like application-specific/octet-stream). But if we do that, nobody >> will be able to get data from Emacs, as such a type is not standard and >> unsupported. Copy-paste with raw binary data is just something most >> apps don't do. > AFAIK, only when TEXT is requested, an selection owner can > choose the returning type from STRING, COMPOUND_TEXT, or > UTF8_STRING. When UTF8_STRING is requested, we should > return it or return nothing. Also IIRC a perfectly valid utf-8 buffer may contain eight-bit-* chars, use to keep track of valid unicode chars that have no corresponding character in emacs-mule. So the presence of eight-bit-* chars does not imply that the utf-8 encoded form of the text will contain an invalid utf-8 byte sequence. > And, if Emacs owns a unibyte string, perhaps the right thing > is to make it multibyte according to the current > lang. env. (by string-make-multibyte) at first, then encode > it by utf-8. That sounds terribly fragile/buggy. Stefan