emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastian Rose <sebastian_rose@gmx.de>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Insert link with "foreign" character - cannot save
Date: Sat, 21 Nov 2009 00:17:01 +0100	[thread overview]
Message-ID: <87einseqhe.fsf@gmx.de> (raw)
In-Reply-To: <AD8A910C-909C-42D0-96C8-94FC091E1DCA@gmail.com> (Carsten Dominik's message of "Fri, 20 Nov 2009 18:03:16 +0100")

Carsten Dominik <carsten.dominik@gmail.com> 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ämting 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 ö (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 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:  \366
>>
>> Next I tried to hack myself a fix :-)
>>
>> I added (?\366 . "%F6") to org-link-escape-chars and ran make on it again,
>> 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ä TAB RET

  [[file:nächtes-nötiges.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 ?ñ
  (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

  reply	other threads:[~2009-11-20 23:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12  9:28 Insert link with "foreign" character - cannot save Mattias Jämting
2009-11-20 17:03 ` Carsten Dominik
2009-11-20 23:17   ` Sebastian Rose [this message]
2009-11-22  1:12     ` Sebastian Rose
2009-11-22  1:32       ` Sebastian Rose
2009-12-07 23:36         ` Mattias Jämting
2009-12-08 16:37           ` Carsten Dominik
  -- strict thread matches above, loose matches on Subject: below --
2009-11-12  9:49 Mattias Jämting

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87einseqhe.fsf@gmx.de \
    --to=sebastian_rose@gmx.de \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).