knight2010 / knight2010.github.io

hub
0 stars 0 forks source link

Convert big5 to utf-8 #2

Open knight2010 opened 9 months ago

knight2010 commented 9 months ago

$ file -i input.file $ cat input.file $ iconv -f ISO-8859-1 -t UTF-8//TRANSLIT input.file -o out.file $ cat out.file $ file -i out.file

knight2010 commented 9 months ago

`

!/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" -o "${file%.txt}.utf8.converted" done exit 0

`