From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joseph Fahey Newsgroups: gmane.emacs.help Subject: g-client: character coding problem Date: Sun, 13 May 2007 16:55:29 +0200 Organization: les newsgroups par Orange Message-ID: <87ejlk7oym.fsf@fabula.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1179166612 4482 80.91.229.12 (14 May 2007 18:16:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 May 2007 18:16:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 14 20:16:51 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hnf6D-0006sF-N3 for geh-help-gnu-emacs@m.gmane.org; Mon, 14 May 2007 20:16:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HnfE0-0003Td-1v for geh-help-gnu-emacs@m.gmane.org; Mon, 14 May 2007 14:24:48 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!grolier!rain.fr!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux) Cancel-Lock: sha1:q4lpMcntA+FZm3wFPUcWMJcnZCA= Original-Lines: 106 Original-NNTP-Posting-Date: 13 May 2007 16:55:34 CEST Original-NNTP-Posting-Host: 86.207.200.59 Original-X-Trace: 1179068134 news.orange.fr 5084 86.207.200.59:13067 Original-X-Complaints-To: abuse@orange.fr Original-Xref: shelby.stanford.edu gnu.emacs.help:148350 X-Mailman-Approved-At: Mon, 14 May 2007 14:22:30 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:43973 Archived-At: Hello all, I am trying to use T. V. Ramah's g-client interface to the Google API, in particular as an interface to Blogger. http://emacspeak.blogspot.com/2007/03/emacs-client-for-google-services.html#cooliris G-client, and more specifically gblogger.el, works great for me... as long as I stick to ASCII characters. Any accented characters from the iso-latin-1 subgroup show up incorrectly. I've tried a lot of different things to alter the coding system, mostly by setting everything I can to utf-8-unix. I think I have found the problem, but am not sure how to solve it. gblogger.el uses xsltproc via shell-command-on-region to prepare a blog, before sending the buffer using curl. It appears that the characters are coming back malformed. Here is the function in g-utils.el: (defsubst g-xsl-transform-region (start end xsl) "Replace region by result of transforming via XSL." (declare (special g-xslt-program)) (let ((coding-system-for-write 'utf-8)) (shell-command-on-region start end (format "%s %s - %s" g-xslt-program xsl (g-xslt-debug)) 'replace))) If I run the following code (the elisp in the middle of this xml) in a utf-8 buffer (-u) I get malformed characters (the accents in the "content" part): http://purl.org/net/emacs-gblogger/ Me ętre

Ętre ou ne pas ętre ? (g-xsl-transform-region (point-min) (point-max) "~/elisp/g-client/blogger-edit-post.xsl")

I get the same results if I change the code to: (let ((coding-system-for-write 'utf-8-unix)) (g-xsl-transform-region (point-min) (point-max) "~/elisp/g-client/blogger-edit-post.xsl")) Here is what I get if I do "C-h C": Coding system for saving this buffer: Not set locally, use the default. Default coding system (for new files): u -- utf-8-unix (alias of mule-utf-8-unix) Coding system for keyboard input: nil Coding system for terminal output: u -- utf-8 (alias of mule-utf-8) Defaults for subprocess I/O: decoding: 1 -- iso-latin-1 (alias: iso-8859-1 latin-1) encoding: 1 -- iso-latin-1 (alias: iso-8859-1 latin-1) Priority order for recognizing coding systems when reading files: 1. iso-latin-1 (alias: iso-8859-1 latin-1) 2. windows-1252 (alias: cp1252) 3. mule-utf-8 (alias: utf-8) ... etc. I suspect that the problem is coming from the defaults for subprocess I/O, but I'm not sure how to change that. So... here I am at wit's end. Any ideas would be much appreciated. thanks Joe PS: this is on Linux with GNU Emacs 22.0.94.2. Here is the output from locale: LANG=fr_FR.UTF-8@euro LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC="fr_FR.UTF-8@euro" LC_TIME="fr_FR.UTF-8@euro" LC_COLLATE="fr_FR.UTF-8@euro" LC_MONETARY="fr_FR.UTF-8@euro" LC_MESSAGES=C LC_PAPER="fr_FR.UTF-8@euro" LC_NAME="fr_FR.UTF-8@euro" LC_ADDRESS="fr_FR.UTF-8@euro" LC_TELEPHONE="fr_FR.UTF-8@euro" LC_MEASUREMENT="fr_FR.UTF-8@euro" LC_IDENTIFICATION="fr_FR.UTF-8@euro" LC_ALL=