emacsdiredcp1251

How to make dired in Emacs use cp1251 under Windows?


I want my default encoding stay utf-8.
But when under Windows - I want to see some of my file names in dired using cp1251. (Because of no utf support in Windows)

Everything displays like: \361\345\354

So how can I make this:

(setq coding-system-for-read 'cp1251)

only for dired mode but not others?


Solution

  • You can try this:

    (add-hook 'dired-mode-hook
              (lambda ()
                (make-local-variable 'coding-system-for-read)
                (setq coding-system-for-read 'cp1251)))