Quick actions

cmd+k|ctrl+k

Navigation

Languages

Convert-Big5-Utf8

Snippet info

Language

Bash

Visibility

public

Author

awesome2023

Created

2023-12-06T15:33:13.333759Z

Updated

2023-12-06T15:50:19.257222Z

echo Convert Big5 to UTF8!

#!/bin/bash
#enter input encoding here
FROM_ENCODING="value_here"
#output encoding(UTF-8)
TO_ENCODING="UTF-8"
#convert
CONVERT=" iconv  -f   $FROM_ENCODING  -t   $TO_ENCODING"
#loop to convert multiple files 
for  file  in  *.txt; do
     $CONVERT   "$file"   >  "${file%.txt}.utf8.converted"
done
exit 0
INFO