Special characters in Emacs dired and attachment paths on Windows 7: "\374" instead of "ü" displayed

3

1

I want to use dired+ in Emacs for browsing directory paths on Windows 7.

I'm having problems with special characters like äöü in dired mode and in attachment paths:

dired

  • When I'm trying to access a directory with M-x dired, the displayed path contains strange characters like e.g.

    • "\374" for "ü"
    • or "\366" for "ö".

Same is true for directory and file listings displayed by dired.

Is there a setting which can make dired display the characters with the correct encoding?

Attachment paths

my other problem seems to be related*:

  • I currently added a long server path as attachment directory in org-mode, like //servername/dir1/dir2/dir2/dir4/etcetera/Zubehör/ (I usually copy the UNC path in Windows 7 Explorer with the PathCopy context menu)

The path is shown like that in :ATTACH_DIR: in the properties with the "ö" correctly displayed. However, when I type C-c C-a C-f to open the directory in Windows Explorer, it creates a new directory at the same path called Zubehör and then opens this oneinstead of the right one.

How can I solve those 2 problems?

MostlyHarmless

Posted 2013-08-28T01:59:03.453

Reputation: 1 708

Answers

3

This is an Emacs bug, not a Dired+ bug, I believe. Emacs on Windows cannot handle Unicode chars in file names. This has been filed as a bug since at least 2010, but it was relegated to the "wishlist", so it's unclear when or whether it will ever be fixed.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15236

Description of a possible fix

The problem is that the mainline Emacs code uses APIs that don't accept wide characters. Examples include 'stat', 'access', 'open', 'fopen', etc. To fix the problem, we'd need to provide our own implementation of these APIs that would accept a UTF-8 encoded file name, then re-encode the file name in UTF-16, and call the Unicode APIs as part of the implementation. This is a large job.

source: Subject: Re: AW: bug#12807: 24.2; Emacs cannot edit file with funny Unicode characters in the file name on Windows; Date: Tue, 06 Nov 2012 05:57:45 +0200

solved in Emacs 24.4

IT finally works in Gnu Emacs 24.4

Drew

Posted 2013-08-28T01:59:03.453

Reputation: 1 898

thanks for your help! However I wonder how this essential feature can be on the "wishlist" for years. This is an essential feature which makes me think if I have to stop using Emacs on Windows. I'm always avoiding special characters in file and path names, but I have to work with network drives where other people saev information who don't care about that. Is it possible to donate money for the fix of a special problem (like that)? – MostlyHarmless – 2013-09-02T07:48:06.760

1

Tell Emacs Dev - every voice helps. But FWIW, this is the response I got when I said the same thing today in the bug thread: "Wishlist" just means it's a missing feature, as opposed to a bug in an existing feature. It doesn't say anything about the importance of the feature that is missing.

– Drew – 2013-09-02T16:27:48.220

yes, I read that discussion. Thanks a lot for your help! – MostlyHarmless – 2013-09-02T20:59:26.683