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?

有帮助吗?

解决方案

You can try this:

(add-hook 'dired-mode-hook
          (lambda ()
            (make-local-variable 'coding-system-for-read)
            (setq coding-system-for-read 'cp1251)))
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top