I have written a file with :set fileencoding=ISO-2022-JP :wq.
When I try to open it again it is completely unreadable. :set encoding? shows that vim has misinterpreted the content as encoding=utf-8.
When I try to change the encoding with :set encoding=ISO-2022-JP vim show as a red text for a shorter time than I could read it, but :messages shows the error message E474: Invalid argument: encoding=ISO-2022-JP.
I have also tried :e ++encoding=ISO-2022-JP but without success, no error message, the text stays the same gibberish.
What am I doing wrong?
encodingis the coding used in Vim internally. This should be of no consequence to your problem. What does:set fileencoding?show after loading the file? – Friedrich Sep 08 '23 at 09:37