Convert big5 encoding to utf8. What should I do at this time? Is it hard to convert each file to utf8? This is not required! Use the iconv command!
In the terminal environment, you can use the "wget URL" to download the above files! Laruence downloads him to the/tmp/vitest directory. Next, let's use the iconv command to play encoding and conversion!
[Root @ www ~] # Iconv -- list
[Root @ www ~] # Iconv-f original encoding-t new encoding filename [-o newfile]
Options and parameters:
-- List: Lists data of languages supported by iconv.
-F: from, that is, the source, followed by the original encoding format;
-T: to, that is, the format of the new encoding later;
-O file: If you want to retain the original file, use the-o new file name to create a new encoding file.
Example 1: Convert/tmp/vitest/vi. big5 to utf8 encoding!
[Root @ www ~] # Cd/tmp/vitest
[Root @ www vitest] # iconv-f big5-t utf8 vi. big5-o vi. utf8
[Root @ www vitest] # file vi *
Vi. big5: ISO-8859 text, with CRLF line terminators
Vi. utf8: UTF-8 Unicode text, with CRLF line terminators
# Yes! Obviously different! Pai_^
This command supports a large number of languages, in addition to the big5 and utf8 encoding of Chinese characters, it also supports gb2312 in simplified Chinese, so friends on the other side can simply download the webpage data of the bird station and use this command to convert it into a simplified one, so that they can easily read the file data! However, do not upload files in simplified form to your own webpage! This is clearly written by laruence, isn't it? Pai_^
However, if you want to convert the utf8 code of the Chinese text to the utf8 code of the simplified Chinese, it will take some effort! For example, if you want to convert the vi. utf8 file to a simplified utf8 file, you can do this:
[Root @ www vitest] # iconv-f utf8-t big5 vi. utf8 | \
> Iconv-f big5-t gb2312 | iconv-f gb2312-t utf8-o vi. gb. utf8