Garbled characters in Linux and in linux

Source: Internet
Author: User
Tags i18n

Garbled characters in Linux and in linux
Modify the/etc/sysconfig/i18n file, as shown in figure
LANG = "en_US.UTF-8", xwindow displays the English interface,
LANG = "zh_CN.GB18030", xwindow displays the Chinese interface.
Another method is cp/etc/sysconfig/i18n $ HOME/. i18n.
Modify the $ HOME/. i18n file, as shown in figure
LANG = "en_US.UTF-8", xwindow displays the English interface,
LANG = "zh_CN.GB18030", xwindow displays the Chinese interface.
In this way, the user interface language can be changed without affecting other users.

The modified/etc/sysconfig/i18n file is:
LANG = "en_US.UTF-8"
SUPPORTED = "zh_CN.GB18030: zh_CN: zh: en_US.UTF-8: en_US: en"
SYSFONT = "latarcyrheb-sun16"
LC_ALL = "en_US.UTF-8"
Export LC_ALL

Restart or use rc. local to make the settings take effect.

Garbled characters in windows text files in linux

Mount Windows partitions 1. Manually mount Windows partitions in Linux, including fat32 and ntfs. First, you need to know the name of Hard Disk Partition in Linux. For example, in Windows, the C drive is generally hda1, the D Drive is hda5, And the e drive is hda6. For details, see the relevant documentation. To mount Windows partitions, you must first determine the locale of your Linux system (this locale includes the language and character encoding information used by the system ). Common locale in Chinese Linux is zh_CN.gb2312, zh_CN.gbk, zh_CN.gb18030 and zh_CN.UTF-8. In the default installation, locale for Debian Linux and Mandriva Linux is zh_CN.gb2312, while locale for Ubuntu Linux and Fedora Linux is a zh_CN.UTF-8. It is best not to change locale at will, otherwise there will be a lot of garbled characters. To view the locale of the system, enter the following command in the terminal: echo $ LANG. Second, you need to know the format of your windows partition, this can be seen in the partition properties of windows, generally in fat32 and ntfs formats. Assuming that your locale is a zh_CN.UTF-8, mount a windows partition in fat32 format in/dev/hda1 to the/mnt/C directory (if this directory does not exist, create a new one manually ), you can enter the following command in the terminal (sudo must be added before this command in Ubuntu ): mount-t vfat/dev/hda1/mnt/C-o iocharset = utf8 if your locale is not a zh_CN.UTF-8, change the utf8 command above to gb2312; if the windows partition is in ntfs format, change the vfat command above to ntfs. In this way, only root partitions in ntfs format can be read. If you want normal users to read partitions, you need to add the umask = 022 option, as shown below: mount-t ntfs/dev/hda1/mnt/C-o iocharset = utf8, umask = 022 Similarly, if you want to allow all users to read and modify the mounted partition, you can change umask = 022 to umask = 0. Detaching a partition is much easier: umount/dev/hda1 sometimes prompts that the partition is busy (device is busy) When detaching the partition. You can use the following command to check which process is using this partition: fuser-cu/dev/hda1 if the output on the screen is/dev/hda1: 8463 m (UDF), you can use this command to check the program name of the process: ps 8463 then you can run this command to end the process: kill-9 8463 so that you can unmount the partition normally. 2. to automatically mount windows partitions when the Linux system starts, you can write the preceding command to the/etc/fstab file. The following is an example: #/etc/fstab: static file system information. # [file system] [mount point] [type] [options] [dump] [pass] proc/proc defaults 0 0/dev & #47 ...... remaining full text>

The text created in Linux is in Windows, and the line feed is garbled.

DOS (Windows) and Unix (Linux) line breaks (line breaks) are different.
You can use unix2dos and dos2unix to convert each other (use -- help to query more information), for example:
Unix2dos file1.txt (converted from Linux to Windows)
Dos2unix file1.txt (converted from Windows to Linux)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.