I already have a test UTF-8 encoded file,
# file -bi TestspecialchrUTF.txt
text/plain; charset=utf-8
Let's convert this file,
# iconv --from-code=utf-8 --to-code=iso-8859-1//TRANSLIT TestspecialchrUTF.txt -o TestISO8859.txt
Here the catch is TRANSLIT switch which is not present in man page of iconv at the time of writing this blog post. Now let's verify the character encoding of newly created file,
# file -bi TestISO8859.txt
text/plain; charset=iso-8859-1
Where, file is a unix command to determine the file type.
Any feedback will be highly appreciated.
Suggested Posts,
- Ping: How to turn off ICMP ECHO Response on Linux Server
- udev: renamed network interface eth0 to eth1
- vCenter Server 5: Important Installation Tip
- Change Login Shell of Linux User
This post appeared on the softlexicon.com by Sumit Goel. Copyright © 2012 – softlexicon.com and Sumit Goel. All rights reserved. Not to be reproduced for commercial purposes without written permission.
Can I ask a question?
ReplyDeleteI am converting UTF-8 to ISO-8859-1 file using the following command
iconv -f UTF-8 -t ISO-8859-1//TRANSLIT input.txt > out.txt
After conversion, when I open the out.txt
¿Quién Gómez is translated to ¿Quien Gomez.
Why is é and ó and others are not translated correctly?
Thank you.