From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.devel Subject: Re: Problems in parsing message's "From" header Date: Mon, 22 Jun 2009 13:58:57 +0300 Message-ID: <8763eo3572.fsf@iki.fi> References: <877hz48zxe.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: Quoted-Printable X-Trace: ger.gmane.org 1245668365 9890 80.91.229.12 (22 Jun 2009 10:59:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2009 10:59:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 22 12:59:21 2009 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.50) id 1MIhF9-0004s2-Gv for ged-emacs-devel@m.gmane.org; Mon, 22 Jun 2009 12:59:19 +0200 Original-Received: from localhost ([127.0.0.1]:51047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIhF8-0003Nh-TO for ged-emacs-devel@m.gmane.org; Mon, 22 Jun 2009 06:59:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIhF2-0003LI-OD for emacs-devel@gnu.org; Mon, 22 Jun 2009 06:59:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIhEx-0003Jn-NU for emacs-devel@gnu.org; Mon, 22 Jun 2009 06:59:11 -0400 Original-Received: from [199.232.76.173] (port=54777 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIhEx-0003Jh-I4 for emacs-devel@gnu.org; Mon, 22 Jun 2009 06:59:07 -0400 Original-Received: from mta-out.inet.fi ([195.156.147.13]:37347 helo=kirsi2.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIhEw-0008OT-TA for emacs-devel@gnu.org; Mon, 22 Jun 2009 06:59:07 -0400 Original-Received: from mithlond.arda.local (80.220.180.181) by kirsi2.inet.fi (8.5.014) id 49F6DD5801FAB8A6 for emacs-devel@gnu.org; Mon, 22 Jun 2009 13:58:58 +0300 Original-Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1MIhEo-0000tS-32 for emacs-devel@gnu.org; Mon, 22 Jun 2009 13:58:58 +0300 In-Reply-To: <877hz48zxe.fsf@iki.fi> (Teemu Likonen's message of "Mon, 22 Jun 2009 10:56:13 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.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:111631 Archived-At: On 2009-06-22 10:56 (+0300), Teemu Likonen wrote: > But if there are some non-latin letters it fails to parse the name > part, for example: > > (mail-header-parse-address "=CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF= =82 =CE=A3=CE=B5=CF=86=CE=AD=CF=81=CE=B7=CF=82 ") > =3D> ("address@invalid") OK, I found another function, mail-extract-address-components, which can parse the above address string: (mail-extract-address-components "=CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF= =CF=82 =CE=A3=CE=B5=CF=86=CE=AD=CF=81=CE=B7=CF=82 ") =3D> ("=CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF=82 =CE=A3=CE=B5=CF=86=CE= =AD=CF=81=CE=B7=CF=82" "address@invalid") So, my problem actually went away. It's probably time to say the usual "sorry for the noise", from my part at least. :-) The problem in mail-header-parse-address is probably valid anyway: > (mail-header-parse-address=20 > (mail-header-from message-reply-headers)) > > Vector message-reply-headers has message's "From" field but person's > name is not enclosed in double quotes. Hence mail-header-parse-address > fails to parse the name. > > So, is this bug or "non-ideal behaviour" (a) in the function > mail-header-parse-address (b) in the code which produces the vector > message-reply-headers or (c) in the code which puts the "From" field > in the buffer in the first place? About the item "c" I should add that > in Gnus's Article buffer there are no double quotes around person's > name. > > Thanks. I'm using up-to-date Emacs CVS/Git version: > > GNU Emacs 23.1.50.3 (i686-pc-linux-gnu, GTK+ Version 2.12.12) of > 2009-06-22 on mithlond