070-8260-2526

9 ~ 6

352-0331-1626-83

:ũڸ


ֹ
Ȩ > > ֹ

ȸ 17572
vi Ϳ utf8, euc-kr ȯϱ
vi Ϳ utf8, euc-kr ȯϱ
by indirock 2012/01/11 09:05 indirock.egloos.com/3791689 ۼ : 0
[vi utf8 <-> euc-kr encoding ȯϱ] : (http://onlyu.blog.me/60123862837)
vi ѱ ְ

<meta http-equiv=Content-Type Content="text/html; charset=euc-kr"> δٸ

ܼâ env LANG=ko_KR.UTF-8 ¸ utf8 ȯԴϴ.

Q) ׷ ѱ ̴ utf-8 ý ȯ濡 euc-kr ΰ?

A) ȯ̶ vi ȯ漳 .vimrc Ͽ set fileencodings=utf8,euc-kr ߰ϸ ڵ fileencoding utf8 euc-kr encoding ° մϴ.

α׾ƿ() ʰ vi ҷ ֿܼ source .vimrc ϰ Ű ˴ϴ.

Q) ׷ euc-kr utf8 Ϸ ϰ ʹٸ  ?

A) vi

:set fileencoding=utf-8

:w

ϸ ˴ϴ. Ḧ ҷ :wq ͸ ϸ ˴ϴ.

ݴ utf8 euc-kr ҷ :set fileencoding=euc-kr ϸ ˴ϴ.

 

euc-kr utf8 ϰ ߴٸ

<meta http-equiv=Content-Type Content="text/html; charset=utf-8">

Ȯνÿ ٽ ѱ ̰.

 

Q) vi ͷ ʰ euc-kr utf8 ҷ մϴ.  ؾ ?

A) iconv ɾ մϴ.

iconv -f euc-kr -t utf-8 euc-kr.html --output utf8.html

or

iconv -f euc-kr -t utf-8 euc-kr.html > utf8.html

Q)Ѱ ƴ϶ html ÿ ҷ  ?

ó utf8.html ʿ ׳ utf-8 Ϸ ȯ Ǹ ڴµ??

A)

ϴ η ̵ ϰ Ʒ ɾ ѹ濡 ׷ ڽϴ.

cd /web/files

for I in ./-.html ; do iconv -c -f euc-kr -t utf-8 $I > $I.tmp && mv $I.tmp $I ; done

۾ Ϸ ϴ ϴ. ׳ tar θ .

ý ȯ濡 ۾ ȯ濡 charset encoding ׽Ʈ ۾ ϰ ϴ ٶմϴ. 

Q) recode ɾ ѹ ִٰ ϴµ  ϳ?

A) ýۿ recode ɾ ִ Ȯ ؾ ϴµ

rpm -qi recode ؼ ƹ͵ ȳ ġ ؾմϴ.

yum install recode recode-devel Ǵ rpm ãƼ ġ ϰų

http://recode.progiciels-bpi.ca/index.html ؼ ޾Ƽ ġմϴ.

recode ɾ 󸶳 charset ִ Ȯ

recode -l ˴ϴ. ׷ euc-kr utf-8 ɾ Ʒ ϴ.

recode -v <ҽ CHARSET>...<ȯ CHARSET> <ϸ>

recode -v EUC-KR...UTF-8 *.html

 

Q) php Ư ڿ euc-kr Ǵ utf8 ҷ  ?

A) iconv Լ ̿ϸ ˴ϴ.

iconv("euc-kr", "utf-8", $str); // euc-kr utf8 encoding ˴ϴ.

iconv("utf-8", "euc-kr", $str); // utf8 euc-kr encoding ˴ϴ.

URL : http://www.php.net/manual/en/function.iconv.php

 

Q) java,jsp ڿ encoding ȯ?

A)

StringBuffer szBuffer = new StringBuffer(); String str = new String(szBuffer.toString().getBytes("UTF-8"), "EUC-KR");

http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html

ѱ ٸ Ʒ Ȳ üũ ϴ.

1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
2. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
3. <Connector URIEncoding="UTF-8" connectionTimeout="10000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/> 4. URIEncoding Ƶ get/post ޼ҵ Ѿ Parameter ѱ
SetCharacterEncodingFilter.java $CATALINA_HOME/common/classes (Ĺ) Ǵ WEB-INF/classes (ȯ) ؿ
javac SetCharacterEncodingFilter.java -d .
ϰ web.xml encoding Ǿ ִ Ȯ ϴ.
* utf8 Ĺ ƴ϶ Ĺ 4.x ⺻ 8859_1α ˴ϴ. export LANG=en_US.iso8859-1
export LANG=ko_KR.eucKR Ѵٸ charset euc-kr ˴ϴ.
߰ ɼ export CATALINA_OPTS='-Dencoding.default=euc-kr -Dfile.encoding=euc-kr'

 

Q) Ʈе(notepad) encoding ȯ ۾ ?

A) 쿡 ۾ notepad++ Ұ 帳ϴ.

http://notepad-plus-plus.org/ ٿε(DOWNLOAD) ޴ ø ˴ϴ.

쿡 ANSI Encoding ޴ Encoding

Convert to UTF-8 without BOM (UTF-8 ȯ BOM ) Ͻø UTF-8 Charset ȯ ˴ϴ.



(notepad++ ޴ ѱ۷ Settings > Preferences > General Localization ׸ ѱ ϸ ˴ϴ.)

(߰)

Q) Ʈ Ѿ ٸ utf8 euc-kr  ?

A) php mb_detect_encoding($str); дϴ.

Ͽ ϴ encoding iconv ȯ ָ ˴ϴ.

 

Ű ˻
[] Locale from ó 㿣 ó
ϸ 丮 Ÿ ko_KR.euckr/* ko_KR.utf8/* ǰ# localedef -cvi ko_KR -f EUC-KR ٲָ ̴.[ó] http://rhdxmr.tistory.com/45, http://kldp.org/node/39014
[mysql] mysqldump Ȯ from ο ϰ, Ÿο ȭϰ
-p1111 abc > dumpfile.sql utf8 euckr ȯϿ dumpϱshell> mysqldump -u abc -p1111 abc --default-charset=euckrmeans that if you want to include in an existing backup script also the triggers and stored
MySQL Tip from ϳθ
utf8 Ǵ euckr ϴ° ̴. ׷ default-character-setmysql> grant all privileges on*.* to root@localhost identified by xxxxxutf8 mysql 4.1 /etc/my.cnf [service:mysqld],
vi Ϳ utf8, euc-kr ȯϱ from indirock's story
StringBuffer() String str = new String(szBuffer.toString().getBytes(UTF-8),* utf8 Ĺ ƴ϶ Ĺ 4.x export LANG=en_US.iso8859-1 export LANG=ko_KR.eucKR Ѵٸ charset euc-kr ˴ϴ.߰
..SQL] mysql configure ɼ(mysql-5.0.77 ... from ̱۷
[VAR=VALUE]...To assign environment variables (e.g., CC, CFLAGS...),cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8greek hebrew hp8 keybcs2 koi8rmacromansjis swe7 tis620 ucs2 ujis utf8--with-collation=COLLATIONDefault