'encoding'에 해당되는 글 1건

  1. 2009.08.31 How to guess or check encoding of text
WEB2009. 8. 31. 11:55
http://osdir.com/ml/linux.debian.internationalization.general/2003-01/msg00011.html

How about trying iconv? If it is not intended encoding, it errors.

For example, if

iconv -f UTF-8 -t ISO-8859-1 <somefile

succeeds, it means the file is UTF-8. Thus, I wrote the following script:


#!/bin/sh
if iconv -f UTF-8 -t UTF-8 <$1 &>/dev/null
then
echo UTF-8
else
echo ISO-8859-1
fi


---
Tomohiro KUBOTA <kubota@xxxxxxxxxx>
http://www.debian.or.jp/~kubota/
Posted by 크롭바디