From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tiphaine Turpin Newsgroups: gmane.emacs.bugs Subject: bug#10919: emacs-mule/utf-8 difference Date: Thu, 01 Mar 2012 16:48:30 +0100 Message-ID: <4F4F9A4E.50506@inria.fr> References: <4F4F984D.2000901@inria.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1330617037 26135 80.91.229.3 (1 Mar 2012 15:50:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Mar 2012 15:50:37 +0000 (UTC) To: 10919@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 01 16:50:36 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S38H6-0004tG-3n for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Mar 2012 16:50:36 +0100 Original-Received: from localhost ([::1]:48758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S38H5-00028m-HR for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Mar 2012 10:50:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S38H2-00027F-5R for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 10:50:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S38Gd-0003HG-FS for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 10:50:31 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S38Gd-0003H3-CM for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 10:50:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S38GX-000473-GY for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2012 10:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tiphaine Turpin Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Mar 2012 15:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10919 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10919-submit@debbugs.gnu.org id=B10919.133061695015737 (code B ref 10919); Thu, 01 Mar 2012 15:50:01 +0000 Original-Received: (at 10919) by debbugs.gnu.org; 1 Mar 2012 15:49:10 +0000 Original-Received: from localhost ([127.0.0.1]:57698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S38Fh-00045G-Gg for submit@debbugs.gnu.org; Thu, 01 Mar 2012 10:49:09 -0500 Original-Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:30805) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S38FW-00044r-3Q for 10919@debbugs.gnu.org; Thu, 01 Mar 2012 10:48:59 -0500 X-IronPort-AV: E=Sophos;i="4.73,511,1325458800"; d="scan'208";a="133865751" Original-Received: from chercheurs2-217.saclay.inria.fr (HELO [193.55.250.217]) ([193.55.250.217]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 01 Mar 2012 16:48:31 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Thunderbird/3.1.16 In-Reply-To: <4F4F984D.2000901@inria.fr> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57421 Archived-At: I just found a solution which seems to work: using emacs-internal instead of emacs-mule. So it seems to be just a documentation problem (or a problem with my reading of it). Tiphaine On 01/03/2012 16:39, Tiphaine Turpin wrote: > Hi, > > I have a problem regarding coding systems: > > I'm using process-send-string to send substrings of a buffer through a > socket, after setting the process encoding and decoding systems to > emacs-mule. > I expect the number of bytes written to match the byte-length of the > substring as obtained by position-bytes, since the specification of > position-bytes in emacs-devel is to always work with the emacs-mule > encoding. From emacs-devel: > > "The byte sequence of a buffer after decoded is always in emacs-mule > (in emacs-unicode-2 branch, it's utf-8). So, changing > buffer-file-coding-system or any other coding-system-related variables > doesn't affects position-bytes." > > However, this is not the case with 3bytes utf8 characters: > position-bytes counts them as 3 bytes, but process-send-string wirtes > 4 bytes. > > Setting the process coding systems for the socket to utf-8 solves the > problem, but I don't think it will with other coding systems, even if > I used buffer-file-coding-system instead, since position-bytes does > not use it. > > What is the real expected behavior of these things, and how to make > this correct ? > > Regards, > > Tiphaine Turpin >