From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel Subject: Re: Bug with UTF-8 string and dbus Date: Wed, 09 Jun 2010 08:34:17 +0200 Message-ID: <87r5kgg1ee.fsf@keller.adm.naquadah.org> References: <87typdnr08.fsf@keller.adm.naquadah.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1276066294 745 80.91.229.12 (9 Jun 2010 06:51:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Jun 2010 06:51:34 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 09 08:51:30 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OMF7K-0005t4-IY for ged-emacs-devel@m.gmane.org; Wed, 09 Jun 2010 08:51:26 +0200 Original-Received: from localhost ([127.0.0.1]:54625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMF79-0005oV-CM for ged-emacs-devel@m.gmane.org; Wed, 09 Jun 2010 02:50:15 -0400 Original-Received: from [140.186.70.92] (port=39472 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMF1i-0002R2-9A for emacs-devel@gnu.org; Wed, 09 Jun 2010 02:44:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMErs-0000tr-Kl for emacs-devel@gnu.org; Wed, 09 Jun 2010 02:34:29 -0400 Original-Received: from prometheus.naquadah.org ([212.85.154.174]:34368 helo=mx1.naquadah.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMErp-0000tL-QY; Wed, 09 Jun 2010 02:34:25 -0400 Original-Received: by mx1.naquadah.org (Postfix, from userid 8) id 7BBBD5C170; Wed, 9 Jun 2010 08:34:23 +0200 (CEST) Original-Received: from keller.adm.naquadah.org (chapai.naquadah.org [82.227.158.144]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.naquadah.org (Postfix) with ESMTPSA id 60B005C177; Wed, 9 Jun 2010 08:34:21 +0200 (CEST) Original-Received: from jd by keller.adm.naquadah.org with local (Exim 4.72) (envelope-from ) id 1OMErk-0000oY-PC; Wed, 09 Jun 2010 08:34:20 +0200 In-Reply-To: (Eli Zaretskii's message of "Tue, 08 Jun 2010 21:17:02 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:125657 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 09 2010, Eli Zaretskii wrote: >> > 492 char *val =3D SDATA (Fstring_make_unibyte (object)); >>=20 >> Fstring_make_unibyte is wrong here. >> Most likely, if the D-Bus specification mandates UTF-8, the better thing >> to do would be either to encode using utf-8, or to take advantage of the >> fact that Emacs already uses utf-8 internally and pass just SDATA (objec= t). According to D-Bus spec[1]: STRING UTF-8 string (must be valid UTF-8). Must be nul terminated and contain no other nul bytes. > Using unencoded SDATA would be wrong with eight-bit characters (aka > raw bytes). I'd suggest to encode, to be on the safe side. Any hint on how to do that ? I mean, I don't know the Emacs C API at all, but I can test some idea/patch if pointed in the appropriate direction. [1] http://dbus.freedesktop.org/doc/dbus-specification.html =2D-=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkwPNekACgkQpGK1HsL+5c0QFACdF4LjnIX6f/Hw5FMdc01Y+zOn N7sAn0y/HEq3k+PfFTJmHjD/B9LmblzA =+8/d -----END PGP SIGNATURE----- --=-=-=--