Subject: Re: bug#14908: Problem opening attachments that contain umlauts

From: Stefan Reichör <[email-masked]>
Date: Fri, 31 Jan 2014 09:21:52 +0100

Hi Lars!

Thanks for looking into this.

> Stefan Reichör <[email-masked]> writes:
>
>> I am not sure if it is an emacs misconfiguration or a gnus problem.
>>
>> When I get an attachment that contains umlauts in the filename I am not
>> able to open it (I have to save it first and then I can open it)
>>
>> I have attached a small pdf file without an umlaut and one containig an umlaut.
>
> I'm unable to reproduce this bug.
>
> These are the messages I get when I hit `RET' on the two attachments:
>
> Viewing with /usr/bin/xdg-open %s
> Displaying /usr/bin/xdg-open /tmp/emm.2023yDH/\ö.pdf...done
> Viewing with /usr/bin/xdg-open %s
> Displaying /usr/bin/xdg-open /tmp/emm.2023_NN/a.pdf...done
>
> What messages do you get?

First I used evince to open pdf files. However switching to xdg-open
does not fix the problem for me:

Viewing with /usr/bin/xdg-open %s
Displaying /usr/bin/xdg-open /tmp/emm.8325I4U/a.pdf...done
Viewing with /usr/bin/xdg-open %s
Displaying /usr/bin/xdg-open /tmp/emm.8325VCb/\ö.pdf...done

xdg-open: file '/tmp/emm.8325VCb/ö.pdf' does not exist

Now I tried the following: I use the log-arg.py script to find out about
the file name that is sent to the external process (put the following
line in ~/.mailcap):
application/pdf; /home/srei/log-arg.py %s; test=test "$DISPLAY" != ""; description=Portable Document Format; nametemplate=%s.pdf

Now I see that ö is encoded as latin-1:
Char: ö (246, #o366, #xf6, file #xF6) point=18 of 23 (74%) column=17

I guess my system expects unicode.
I invoked the log-arg.py script from the shell and get cmd-arg1-shell.

I use the following setup in my .emacs:

(prefer-coding-system       'utf-8)
(set-default-coding-systems 'utf-8)
(setq file-name-coding-system 'utf-8)
(setq-default buffer-file-coding-system 'iso-latin-1)
(set-language-environment 'Latin-1)

Thanks,
  Stefan.