I can view http://hosting2.phor.net/~bolomi/ and save this to a file. In Chrome, I can view source and see the title of the page is 波羅蜜. If I open the saved file in vim to edit, I see question marks for those characters. Then if I :set encoding=gb2312 I will see the first two characters and then question marks. If, instead, I do :e ++enc=gb2312 %:p I will see the middle character.

After the file is open (because I use MacVim and Fetch opens the file for me automatically) what is the correct workflow to edit this file?


I found specifying set encoding=cp936 for the troublesome *.ahk script solved my problem altogether.

Source: 用vim打开后中文乱码怎么办? - doacker的回答 - 知乎

  • Thank you. Obviously Zhihu is where I should have asked first! – William Entriken Aug 22 '19 at 13:58

gb2312 only does simplified characters.

Firefox, Mozilla, and python2-chardet-2.0.1 all lie and say this is gb2312, but since it has traditional characters, the charset needed is gb18030.

So: if it looks like a duck, quacks like a duck, smells like a duck, and tastes like a duck... open the file with hexdump and read the codepage definition file.


I have vim set to use UTF-8, as as far as I can see the characters correctly. Maybe try

set encoding=utf-8

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.