From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Insert link with "foreign" character - cannot save Date: Sun, 22 Nov 2009 02:12:55 +0100 Message-ID: <87r5rrbbvs.fsf@gmx.de> References: <000001ca637a$8f7c04f0$ae740ed0$@se> <87einseqhe.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NC10r-0007Ad-0L for emacs-orgmode@gnu.org; Sat, 21 Nov 2009 20:13:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NC10m-00078S-6U for emacs-orgmode@gnu.org; Sat, 21 Nov 2009 20:13:12 -0500 Received: from [199.232.76.173] (port=43035 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NC10m-00078P-3M for emacs-orgmode@gnu.org; Sat, 21 Nov 2009 20:13:08 -0500 Received: from mail.gmx.net ([213.165.64.20]:46444) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NC10l-0001oC-Hz for emacs-orgmode@gnu.org; Sat, 21 Nov 2009 20:13:07 -0500 In-Reply-To: <87einseqhe.fsf@gmx.de> (Sebastian Rose's message of "Sat, 21 Nov 2009 00:17:01 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org OK, this is a severe Emacs 23 bug. I can reproduce the errors like this: sh$ mkdir test sh$ cd test sh$ touch =C3=BCml=C3=A4ute.org sh$ ls =C3=BCml=C3=A4ute.org sh$ convmv --notest -f utf-8 -t iso-8859-1 =C3=BCml=C3=A4ute.org=20 Your Perl version has fleas #37757 #49830=20 mv "./=C3=BCml=C3=A4ute.org" "./=EF=BF=BDml=EF=BF=BDute.org" Ready! sh$ ls ?ml?ute.org Now I open an Org-file in Emacs 23, and do C-u C-c C-l Navigate to that file and BAMM - cannot save my work anymore!!! Another nice test: Try to recode an UTF-8 encoded file name with German Umlauts unsing M-x recode-file-name=20 It does not work either. I'll file an Emacs bug report as this is no bug in Org-mode. Sebastian Sebastian Rose writes: > Carsten Dominik writes: > >> Hi Mattias, >> >> I tried that, and my buffer swiched to unicode encoding automatically. >> >> Unfortunately I don't know much about coding systems, and so I do >> not know how to fix this. >> >> Anyone???? >> >> - Carsten >> >> On Nov 12, 2009, at 10:28 AM, Mattias J=C3=A4mting wrote: >> >>> (I'm using English Windows Vista x64, Emacs 23.1 and Org-mode 6.32b) >>> >>> So i'm doing C-u C-c C-l to browse for a file in order to insert a link= to >>> it. >>> >>> The path and/or the filename contains for instance an =C3=B6 (an o with= two dots >>> above it, also the swedish word for "island"), which gets translated in= my >>> org-file as \366. >>> >>> When I try to save the file I see the message: >>> >>> These default coding systems were tried to encode text >>> in the buffer `jwd.org': >>> (utf-8-dos (79 . 4194294)) >>> However, each of them encountered characters it couldn't encode: >>> utf-8-dos cannot encode these: These default coding systems were tri= ed >>> to encode text >>> in the buffer `jwd.org': >>> (utf-8-dos (79 . 4194294)) >>> However, each of them encountered characters it couldn't encode: >>> utf-8-dos cannot encode these: \366 >>> >>> Next I tried to hack myself a fix :-) >>> >>> I added (?\366 . "%F6") to org-link-escape-chars and ran make on it aga= in, >>> but it didn't seem to work. > > > It's true, you cannot encode the bytes with dec. values above 127 in > utf-8 (see `man utf-8', unicode.org, whatever). > > > > Seems your filenames are not utf-8 encoded. > > Here it works, because on current Linux distros (and MAC OS??) filenames > are utf-8 encoded: > > C-u C-c C-f > n=C3=A4 TAB RET > > [[file:n=C3=A4chtes-n=C3=B6tiges.org][Umlaute in Dateinamen]] > > > Maybe, if the file is from an old system, rename it (twice, to give it > the original name) and try again. Would that work? > > > > > There's an interesting discussion going on on emacs-devel, that might be > related (but it's not about filenames). You may read the entire thread > here: > > http://lists.gnu.org/archive/html/emacs-devel/2009-11/msg00661.html > > > The fazit so far, as I understood it, is, that Emasc 23 distinguishes > single and multibyte strings. Better not use array functions to handle > strings (which are multibyte internaly) in Emacs 23. > > The OP did > > (setq nl "\n") > (aset nl 0 ?=C3=B1 > (insert nl) > > which sets the first _byte_ of an array to 241, which in turn has no > valid representation on screen as character in Unicode (see `man urf-8' > and unicode.org). Thus Emacs insert \361 - for some reason :) > > > > Sebastian > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode