

[Bash] Convert Files in Directory From Big5 to UTF-8
source link: http://siongui.github.io/2016/03/18/bash-convert-files-in-directory-from-big5-to-utf8/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

[Bash] Convert Files in Directory From Big5 to UTF-8
March 18, 2016
Question:
A lot of HTML files under dhpstory directory. The encoding of the files is Big5. Converted them to UTF-8 encoding via iconv command.
Answer:
convert.sh | repository | view raw
#!/bin/sh # Convert all files in directory from Big5 to UTF-8 # list all files recursively for file in $(find dhpstory/ -type f) do output=${file}-utf8.html echo "\033[92mConverting ${file} (BIG5) to ${output} (UTF8) ...\033[0m" iconv -f BIG5 -t UTF8 ${file} > ${output} done
References:
[1][Bash] List All Files in Directory Recursively and Rename
Recommend
-
9
Using Iconv to convert UTF-8 to ASCII (on Linux) Posted: 2007-08-21 - Last updated: 2019-06-05 Tagged
-
10
使用 git diff 比對 UTF-16/BIG5 文字檔-黑暗執行緒 同事遇到的茶包。 git diff 時某文字檔被當成二進位檔案無法顯示差異,後來發現是 Unicode 編碼(UTF-16 LE with BOM/UCS-2 LE with BOM)造成,用以下範例重現: type a.txt 可檢視文字內...
-
10
BIG5 GB2312繁簡編碼快篩 2014-04-27 07:55 PM
-
10
[Golang] Convert File Encoding From Big5 to UTF-8 March 21, 2016 ...
-
4
[Bash] find Command Exclude Sub-directory May 19, 2016 Use
-
7
[Bash] List All Files in Directory Recursively and Rename February 02, 2015
-
11
[Bash] Rename Files in Directory to Lowercase April 25, 2016 Convert the name of...
-
7
[Bash] Remove Execute Permission of Files in Directory Recursively ...
-
8
再談集保罕用字集與 BIG5 造字區 2017-08-18 08:05 AM 3
-
4
Convert all files in directory to webp, with default params, or standard cwebp params passed from command · GitHub ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK