From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Linking Emacs with libxml2 Date: Wed, 08 Sep 2010 16:40:56 +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 X-Trace: dough.gmane.org 1283956882 19008 80.91.229.12 (8 Sep 2010 14:41:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Sep 2010 14:41:22 +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:41:20 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 1OtLpp-000713-CP for ged-emacs-devel@m.gmane.org; Wed, 08 Sep 2010 16:41:13 +0200 Original-Received: from localhost ([127.0.0.1]:41641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtLpo-0001EG-I8 for ged-emacs-devel@m.gmane.org; Wed, 08 Sep 2010 10:41:12 -0400 Original-Received: from [140.186.70.92] (port=53266 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtLpb-0001Cl-L5 for emacs-devel@gnu.org; Wed, 08 Sep 2010 10:41:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtLpa-0002Vf-Hk for emacs-devel@gnu.org; Wed, 08 Sep 2010 10:40:59 -0400 Original-Received: from impaqm5.telefonica.net ([213.4.138.5]:53066) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtLpa-0002VG-BP for emacs-devel@gnu.org; Wed, 08 Sep 2010 10:40:58 -0400 Original-Received: from IMPmailhost3.adm.correo ([10.20.102.124]) by IMPaqm5.telefonica.net with bizsmtp id 46r41f00C2h2L9m3REgxwR; Wed, 08 Sep 2010 16:40:57 +0200 Original-Received: from ceviche.home ([83.61.36.43]) by IMPmailhost3.adm.correo with BIZ IMP id 4Egw1f00A0vquEj1jEgwXP; Wed, 08 Sep 2010 16:40:57 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Original-Received: by ceviche.home (Postfix, from userid 20848) id 55DD7660D2; Wed, 8 Sep 2010 16:40:56 +0200 (CEST) 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/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:129783 Archived-At: >> I'll take a whack at providing an interface to htmlParseDoc(), then, if >> nobody else beats me to it... > 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 > 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. I don't think there's such a utility function. But since the internal encoding of multibyte buffers is a variant of utf-8, you should be able to feed the internal byte-stream directly without extra decoding (assuming libxml2 accepts utf-8 input, of course). Stefan