From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= 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 08:15:19 +0200 Message-ID: <450F8AF7.5010702@swipnet.se> 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=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1158646575 16413 80.91.229.2 (19 Sep 2006 06:16:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2006 06:16:15 +0000 (UTC) Cc: richard.stallman@gnu.org, emacs-pretest-bug@gnu.org, ihs_4664@yahoo.com, christopher.ian.moore@gmail.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 19 08:16:12 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 1GPYtj-0006BF-TO for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2006 08:16:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPYtj-0004bn-1d for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2006 02:15:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GPYtX-0004bA-91 for emacs-devel@gnu.org; Tue, 19 Sep 2006 02:15:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GPYtV-0004ak-NH for emacs-devel@gnu.org; Tue, 19 Sep 2006 02:15:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPYtV-0004ah-JJ; Tue, 19 Sep 2006 02:15:45 -0400 Original-Received: from [81.228.8.186] (helo=av12-2-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GPYwV-0004A3-S5; Tue, 19 Sep 2006 02:18:52 -0400 Original-Received: by av12-2-sn2.hy.skanova.net (Postfix, from userid 502) id 54F8838520; Tue, 19 Sep 2006 08:15:44 +0200 (CEST) Original-Received: from smtp4-2-sn2.hy.skanova.net (smtp4-2-sn2.hy.skanova.net [81.228.8.93]) by av12-2-sn2.hy.skanova.net (Postfix) with ESMTP id 462F6384F9; Tue, 19 Sep 2006 08:15:44 +0200 (CEST) Original-Received: from coolsville.localdomain (81-235-205-78-no59.tbcn.telia.com [81.235.205.78]) by smtp4-2-sn2.hy.skanova.net (Postfix) with ESMTP id BE10937E47; Tue, 19 Sep 2006 08:15:43 +0200 (CEST) User-Agent: Thunderbird 1.5.0.5 (Macintosh/20060719) Original-To: Kenichi Handa In-Reply-To: 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:59998 gmane.emacs.pretest.bugs:13993 Archived-At: Kenichi Handa skrev: > In article <450C3380.2050008@swipnet.se>, "Jan D." writes: > >> 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. > > 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. What would that do to illegal UTF-8 sequences in the original unibyte string? I.e. will this procedure always produce valid UTF-8 data? Jan D.