Although the Linux system is free and vulnerable to virus tools, it is able to compete with Microsoft's operating system on the operating system platform. However, due to various restrictions, for example, some software must run on Windows platform, such as the financial department's VAT Certification software, personal income tax reporting software, and design department's product design software, therefore, enterprises still cannot abandon the Windows operating system. Therefore, how the Linux operating system can coexist with the Windows operating system becomes a topic for the Linux System Senior Administrator.
Next, I will give a list of the Linux and Windows operating systems that I encountered at work based on my years of work experience, it is hoped that these contents will help Linux fans in their practical work.
1. Chinese file names in Windows operating systems are garbled in Linux.
If users often report to me a file they have created in a Windows operating system, such as an Excel table created by financial personnel for employee salary card numbers. However, the Administration Department uses a Linux system. When the Finance Department sends the file to the Administrator, the administrator can see a garbled file name, instead of displaying the employee salary card number normally. In fact, this problem often occurs when the Linux operating system and the Windows operating system coexist. So how can we solve this problem?
Solution:
This is mainly caused by the difference in character encoding formats between Windows and Linux. In Linux, UTF-8 encoding is used, while in Windows, GDK encoding is generally used. Therefore, in the Windows operating environment, the file name can be normally displayed, but in the Linux operating system, it cannot be normally displayed, and garbled characters are displayed, in addition, the content of the file is garbled.
In this case, we need to use the iconv command to convert the file name and the encoding format of the file content. For example, a file provided by a financial clerk to an administrator, the employee payroll card number .txt is garbled in Linux. At this time, we can use the Linux operating system terminal (also known as the command line in Windows) mode, use the iconv format for conversion.
Iconv-f gdk-t utf8 employee wage card number .txt> employee wage card number .txt. utf8
Note the case sensitivity. In a Linux operating system, it is case sensitive when using a terminal for command operations. This is different from the command line format in Windows. The command line mode in Windows is case-insensitive, and the DIR and dir commands are equivalent. However, in Linux terminal mode, the LS and ls commands are different.
However, this is only an appropriate method at the moment. If such a conversion is required every time, it will be too troublesome to handle. Is there any permanent way? My current practice is to use OPEN-source text processing software of open office instead of OFFICE software of OFFCIE in the company. This software root OFFICE has very similar functions, but is actually open-source. Most importantly, it provides excellent support for Linux. Generally, in a Windows operating system, if files created using open office are opened in a Linux operating system, these garbled characters will not occur.