From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: Linking Emacs with libxml2 Date: Wed, 08 Sep 2010 16:25:22 +0200 Message-ID: References: <8A20526E-44B3-4434-9D40-54A36F976CD6@mit.edu> <4C85892B.5080105@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1283957397 21863 80.91.229.12 (8 Sep 2010 14:49:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Sep 2010 14:49:57 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 08 16:49:56 2010 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 1OtLyF-0003ZL-Pu for ged-emacs-devel@m.gmane.org; Wed, 08 Sep 2010 16:49:56 +0200 Original-Received: from localhost ([127.0.0.1]:40042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtLy8-0007SC-2x for ged-emacs-devel@m.gmane.org; Wed, 08 Sep 2010 10:49:48 -0400 Original-Received: from [140.186.70.92] (port=33624 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtLad-0007EO-BD for emacs-devel@gnu.org; Wed, 08 Sep 2010 10:25:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtLaW-0007rs-Ia for emacs-devel@gnu.org; Wed, 08 Sep 2010 10:25:28 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.9]:46344) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtLaW-0007rZ-CA for emacs-devel@gnu.org; Wed, 08 Sep 2010 10:25:24 -0400 Original-Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 4E9581C159B5 for ; Wed, 8 Sep 2010 16:25:23 +0200 (CEST) Original-Received: from hase.home (ppp-88-217-104-156.dynamic.mnet-online.de [88.217.104.156]) by mail.mnet-online.de (Postfix) with ESMTP id F113E1C001EC for ; Wed, 8 Sep 2010 16:25:22 +0200 (CEST) X-Yow: My life is a patio of fun! In-Reply-To: (Lars Magne Ingebrigtsen's message of "Wed, 08 Sep 2010 16:10:18 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:129784 Archived-At: Lars Magne Ingebrigtsen writes: > My main problem is, of course, the most trivial one -- how do I take a > (narrowed) buffer, apply the charset decoding methods, and then up with Do you mean encoding? > a C string that I can feed to the library? There must be a convenient > utility function somewhere, but I haven't been able to find it. Do you really need that C string? I think it would be more efficient if you could pass it a function that delivers the characters while encoding the buffer contents on the fly. Otherwise, encode-coding-region should do what you need. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."