Aug 282012
 

최근의 대부분 웹페이지는 UTF-8을 사용하고 있습니다.

예전에 만들어진 EUC-KR 페이지를 UTF-8로 변환하는 경우가 많이 있습니다.
이런 경우에 일일이 파일을 converting을 해야 하는데요. 간단한 스크립트를 이용해서 편리합니다.

[smlee@localhost ~]# cat conv.sh
#!/bin/sh
 
set -x
iconv -f uhc -t utf-8 $1 > /tmp/a
RET=$?
 
if [ $RET -eq 0 ]; then
        mv /tmp/a $1
else
        echo "FAIL : $1";
fi

위의 스크립트를 ls -1 > 1.sh 로 만든 다음에 vi에서 1.sh를 치환해서 모든 파일에 대해서 conv.sh를 실행하도록 아래와 같이 설정하면 빠르게 치환이 가능합니다.

[smlee@localhost ~]# cat 1.sh
sh conv.sh index.php
sh conv.sh main.php
Print Friendly

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/smlee/blog/wordpress/wp-content/plugins/seo-facebook-comments/seofacebook.php on line 488

Warning: Invalid argument supplied for foreach() in /home/smlee/blog/wordpress/wp-content/plugins/seo-facebook-comments/seofacebook.php on line 490

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Plugin from the creators of Brindes :: More at Plulz Wordpress Plugins