3

In emacs on Windows 8.1 I can't open a file if its full name contains Russian letters [and generally any non-ascii char]. For example, if I try to open D:\ББББ\test.txt I get:

enter image description here

I find a config which seems relevant:

(setq default-file-name-coding-system 'cp1251)

and also tried to set it to utf-8 -- but it doesn't help. I use same config as on linux where I never had problems like this.

Edit:

I'm using vanilla emacs 24.3 for windows and the issue is reproduced with emacs -Q.

Edit 2:

I'm using English version of Windows:

PS D:\> reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage

HKEY_LOCAL_MACHINE\system\controlset001\control\nls\language
    Installlanguage    REG_SZ    0409

(code 0409 means it is English). However other programs, e.g. notepad++, can open the file.

Edit 3:

Default code page is 437:

C:\chcp
Active code page: 437

and it doesn't have Russian chars.

Edit 4

Found an old thread -- seems like the problem is still there.

Edit 5:

Currently one can't open file with unicode in its full name using emacsclient. I'm using the following workaround in order to open files with unicode in their names in an opened emacs: one can use a custom multi-commander command:

enter image description here

I bind this to C-S-F4, and open dired in the respective folder, and browse to the file I want with dired. E.g. for d:\ББББ\test.txt I would open d:\ with C-S-F4 first, and browse to the test.txt with dired.

  • Are you using Cygwin version of Emacs or did you build it yourself / downloaded a build made by someone else? – wvxvw Sep 3 '15 at 21:23
  • @wvxvw: I'm using vanilla emacs 24.3 for windows. – Adobe Sep 4 '15 at 3:35
  • Are you on a Russian version of windows? Even if you're not, this may still be a bug. What is the value of w32-unicode-filenames? – Random832 Sep 4 '15 at 3:50
  • @Random832: I'm using English version of windows. – Adobe Sep 4 '15 at 4:08
  • what is the value of w32-unicode-filenames – Random832 Sep 4 '15 at 4:24
6
+200

There is a new feature in Emacs from version 24.4 for using Unicode strings to access filenames in Windows. This allows using filenames containing characters that are not in the locale's 8-bit character set, which was previously impossible.

http://masteringemacs.org/article/whats-new-in-emacs-24-4

Emacs on Windows 2000 and later can now access files and directories whose names cannot be encoded in the current system codepage. The new variable w32-unicode-filenames controls this feature: if it is t, Emacs uses Unicode APIs to pass file names to system calls, which lifts the limitation of file names to the current locale.

This is not supported, however, by emacsclient, which simply uses the non-unicode argv to read the list of filenames.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.