From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kostas Zorbadelos Newsgroups: gmane.emacs.help Subject: Re: gnus-icalendar international character handling Date: Thu, 25 Feb 2016 15:15:37 +0200 Organization: No affiliation Message-ID: <87bn752ao6.fsf@otenet.gr> References: <87si0ioqqb.fsf@gnus.org> <87oab6a36u.fsf@xing.com> Reply-To: kzorba@otenet.gr NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456406178 23673 80.91.229.3 (25 Feb 2016 13:16:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Feb 2016 13:16:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Lars Magne Ingebrigtsen To: Jan Tatarik Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 25 14:16:01 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aYvlv-0003BN-ME for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Feb 2016 14:15:59 +0100 Original-Received: from localhost ([::1]:43253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYvlu-0001om-I2 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Feb 2016 08:15:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYvlh-0001nl-38 for help-gnu-emacs@gnu.org; Thu, 25 Feb 2016 08:15:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYvld-0003zJ-Rv for help-gnu-emacs@gnu.org; Thu, 25 Feb 2016 08:15:45 -0500 Original-Received: from calypso.otenet.gr ([83.235.67.36]:58640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYvld-0003z0-F2 for help-gnu-emacs@gnu.org; Thu, 25 Feb 2016 08:15:41 -0500 Original-Received: from otenet.gr (enigma.otenet.gr [212.205.221.10]) by calypso.otenet.gr (ESMTP) with ESMTPSA id A3E07138049; Thu, 25 Feb 2016 15:15:37 +0200 (EET) In-Reply-To: <87oab6a36u.fsf@xing.com> (Jan Tatarik's message of "Wed, 24 Feb 2016 10:05:29 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 83.235.67.36 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109309 Archived-At: Hi, this fix (removing the localized day) does not seem to fix the international character display of calendar events and their export to org files. Also, there is the timezone issue I mentioned in the other thread. For the record, saving the calendar MIME part (gnus-mime-save-part) and then importing it to a diary file with (icalendar-import-file) seems to work really well (handling international characters and timezone). Regards, Kostas Jan Tatarik writes: > On Wed, Feb 24 2016, Lars Magne Ingebrigtsen wrote: > >> Kostas Zorbadelos writes: > >>> after activation of gnus-icalendar, the text/calendar MIME parts are not >>> shown properly in gnus if they contain international (in my case Greek) >>> characters (e.g. in Summary or Description). >>> The export to org file also saves the relevant part as raw text and >>> prompts for encoding. Is there any way to fix this? > >> Yeah, I think including the (localised) week day here just seems likely >> to break lots of stuff... Does that have to be included in these time >> stamps? > > This works for me. > > > diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el > index d7a431a..3df3a8c 100644 > --- a/lisp/gnus/gnus-icalendar.el > +++ b/lisp/gnus/gnus-icalendar.el > @@ -394,10 +394,10 @@ gnus-icalendar-event:org-timestamp > "Build `org-mode' timestamp from EVENT start/end dates and recurrence info." > (let* ((start (gnus-icalendar-event:start-time event)) > (end (gnus-icalendar-event:end-time event)) > - (start-date (format-time-string "%Y-%m-%d %a" start)) > + (start-date (format-time-string "%Y-%m-%d" start)) > (start-time (format-time-string "%H:%M" start)) > (start-at-midnight (string= start-time "00:00")) > - (end-date (format-time-string "%Y-%m-%d %a" end)) > + (end-date (format-time-string "%Y-%m-%d" end)) > (end-time (format-time-string "%H:%M" end)) > (end-at-midnight (string= end-time "00:00")) > (start-end-date-diff > @@ -417,7 +417,7 @@ gnus-icalendar-event:org-timestamp > ;; A 0:0 - A+1 0:0 -> A > ;; A 0:0 - A+n 0:0 -> A - A+n-1 > ((and start-at-midnight end-at-midnight) (if (> start-end-date-diff 1) > - (let ((end-ts (format-time-string "%Y-%m-%d %a" (time-subtract end time-1-day)))) > + (let ((end-ts (format-time-string "%Y-%m-%d" (time-subtract end time-1-day)))) > (format "<%s>--<%s>" start-date end-ts)) > (format "<%s%s>" start-date repeat))) > ;; end midnight > @@ -425,7 +425,7 @@ gnus-icalendar-event:org-timestamp > ;; A .:. - A+n 0:0 -> A .:. - A_n-1 > (end-at-midnight (if (= start-end-date-diff 1) > (format "<%s %s-23:59%s>" start-date start-time repeat) > - (let ((end-ts (format-time-string "%Y-%m-%d %a" (time-subtract end time-1-day)))) > + (let ((end-ts (format-time-string "%Y-%m-%d" (time-subtract end time-1-day)))) > (format "<%s %s>--<%s>" start-date start-time end-ts)))) > ;; start midnight > ;; A 0:0 - A .:. -> A 0:0-.:. (default 1) > -- Kostas Zorbadelos http://gr.linkedin.com/in/kzorba