Question

Can we change from ASCII to BIG5??

Actually I have to generate a file in BIG5 format from ASCII format and I am not able to find a way to change the encoding of the file. My file created here contains Chinese data which is not displayed in ASCII format and it can only be displayed in BIG5 format.So once I have created an ASCII file I need to convert it to the BIG5. So thats why I need it to convert to BIG5.

Was it helpful?

Solution

I have no idea how a file in ASCII encoding could contain Chinese data but if it were possible this would be the command:

iconv -f ASCII -t BIG5 asciifile -o big5file.txt

It will convert your file in ASCII encoding to BIG5 and write the output to big5file.txt.

But most likely it is not ASCII that you have in the original file. Make sure you detect the exact encoding and then use it in the command. Use iconv -l to view all available encodings.

You can try to figure out the real encoding with chardet or cchardet. If not available in your terminal, you can install it with pip install chardet (or pip install cchardet).

Once installed pass the the file name as first argument:

 chardet Tian.Jiang.Xiong.Shi.srt 
      >>> Tian.Jiang.Xiong.Shi.srt: GB2312 with confidence 0.99

If you install with pip3 then the script name will be chardet3 or chardetect3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top