From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82556 Path: news.gmane.org!not-for-mail From: Uwe Brauer Newsgroups: gmane.emacs.gnus.general Subject: [SOLVED] (was: coding problem UTF8) Date: Fri, 30 Nov 2012 22:29:25 +0100 Message-ID: <87wqx26aq2.fsf_-_@mat.ucm.es> References: <87obih4a6q.fsf@mat.ucm.es> <8438zrbwsc.fsf@davestoy.homelinux.org> <871ufbf9sg.fsf_-_@gilgamesch.quim.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1354311052 24889 80.91.229.3 (30 Nov 2012 21:30:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Nov 2012 21:30:52 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M30822@lists.math.uh.edu Fri Nov 30 22:31:03 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TeYAo-0002Ww-IK for ding-account@gmane.org; Fri, 30 Nov 2012 22:31:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1TeY9X-00044M-K3; Fri, 30 Nov 2012 15:29:43 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1TeY9W-00044D-GY for ding@lists.math.uh.edu; Fri, 30 Nov 2012 15:29:42 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TeY9T-0007Pq-Nt for ding@lists.math.uh.edu; Fri, 30 Nov 2012 15:29:41 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1TeY9R-00012X-Mz for ding@gnus.org; Fri, 30 Nov 2012 22:29:37 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TeY9Z-00012Q-S2 for ding@gnus.org; Fri, 30 Nov 2012 22:29:45 +0100 Original-Received: from 171.pool85-55-19.dynamic.orange.es ([85.55.19.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Nov 2012 22:29:45 +0100 Original-Received: from oub by 171.pool85-55-19.dynamic.orange.es with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Nov 2012 22:29:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 171.pool85-55-19.dynamic.orange.es X-Hashcash: 1:20:121130:gmane.emacs.gnus.general::x9cwflBxtfe+wzwH:0000000000000000000000000000000000000DXi3 User-Agent: Gnus/5.110018 (No Gnus v0.18) XEmacs/21.5-b31 (linux) Cancel-Lock: sha1:dRv8LBlA0hkDy2OzyFdU4V4fMlA= X-Spam-Score: -2.3 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82556 Archived-At: > I hope the bad encoded UTF8 chars reach the group > I have á etc instead of à > So I have to run > (decode-coding-region start end 'utf-8 nil) The following modification works for me: (defun dsg-icalendar-handle-part (handle) (when (equal (car (mm-handle-type handle)) "text/calendar") (with-temp-buffer (insert (mm-get-part handle)) (if (equal (mm-handle-encoding handle) 'uuencode) (uudecode-decode-region-internal (point-min) (point-max))) (goto-char (point-min)) (decode-coding-region (point-min) (point-max) 'utf-8 nil) (let* ((e (car (icalendar--all-events (icalendar--read-element nil nil)))) (subject (icalendar--convert-string-for-import (or (icalendar--get-event-property e 'SUMMARY) "No Subject"))) (dtstart (icalendar--get-event-property e 'DTSTART)) (dtstart-dec (icalendar--decode-isodatetime dtstart)) (start-d (icalendar--datetime-to-diary-date dtstart-dec)) (start-t (icalendar--datetime-to-colontime dtstart-dec)) (repq (icalendar--get-event-property e 'RRULE))) (if (y-or-n-p (format "Add %s for \"%s\" on %s at %s to diary? " (if repq "repeating event" "appointment") subject start-d start-t)) (icalendar-import-buffer (expand-file-name (if repq "~/repeating-diary" "~/ical-diary")) t nil)))))) Uwe