使用 file -b --mime-encoding 命令行获取文件编码, 在打开文件时指定编码即可 def get_file_encoding(file_path) `file -b --mime-encoding #{file_path}`.strip end file_path = '/Users/xander/Downloads/ideavim.txt' encoding...

Vicw.com用户头像 - XanderCheung XanderCheung 1111 0 1