What should I do if the Windows file shows garbled characters on Ubuntu?

  
                

In Ubuntu system, when reading Windows files, it shows garbled characters, while Windows reads normally. The main reason for the problem is the difference in encoding. The following small series will introduce you to Windows files displayed on Ubuntu. Garbled solution.

to Ubuntu 13.04 for example

garbled reasons:

This is because the garbage problem in the Windows default encoding is GBK, in the case of ubuntu is UTF- 8, so the comments under Windows, Ubuntu will become garbled.

Install vim

Run in command line mode

sudo apt-get install vim

Find vim configuration folder

Generally not modified in this file

Add configuration file in your home directory

1 Run vim ~/.vimrc command

2 “ is the comment start symbol

set nu ”Set display line number

syntax on “Open syntax check

set showmode ”Show state in lower left corner

set autoindent &ldquo ; indentation

set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936

set termencoding=utf-8

set encoding=utf -8

Save OK.

The above is the solution to display garbled characters on Windows files on Ubuntu. If you encounter the same problem, you need to install the vim tool to reconfigure the file and operate it on the command line.

Copyright © Windows knowledge All Rights Reserved