Sergey
Sergey

Reputation: 21261

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?

Upvotes: 2

Views: 434

Answers (1)

Saddle Point
Saddle Point

Reputation: 3224

You can try this:

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

Upvotes: 5

Related Questions