How to use Unicode in your PHP applications | Browser Based Game Development

2009-12-09 01:12 / hittings

The first step to take is to ensure that all your source files are stored UTF-8 encoded. This option really depends on the editor you are using so you maybe have to consult your editor’s documentation to find out how to do that.

UTF-8 is one out of many character encodings for Unicode. And out of them it is the most commonly used one today – at least for web applications.

via How to use Unicode in your PHP applications | Browser Based Game Development.

まぁアメリカ人から見ると日本語も中国語もハングルも同じように見えるのかもしれんが、僕らのコーディングで使っている UTF-8N は、ハングルを正しく扱えないのである。いま某専門学校のサイトをコーディングしているのだが、「留学生のみなさまへ」という語句を Google Translate で「유학생 여러분에게」と訳して(これが正しいのかどうか知らんが)、xyzzy に貼り付けてみよう。その場ではうまく表示されるが、そのファイルを閉じて開き直すと、「????????」になっているはずだ。正確に表示しようと思えば、UTF-8N [KR] というエンコーディングで保存しなくてはいけない。ただ、常に正しくそのエンコーディングで開く保証はないので、文字数が多くなければ数値参照に変換する方がよいだろう(「留学生のみなさまへ」なら、「&# 50976;&# 54617;&# 49373; &# 50668;&# 47084;&# 48516;&# 50640;&# 44172;」となる。ちなみに、途中で改行してくれないので、&# と数値のあいだに半角スペースを入れてあるので注意されたし)。

コメントがあればどうぞ

monthly archives

yearly archives

archive

microformat (vCard)

KAWAMOTO Takayuki

Mr. KAWAMOTO Takayuki
also known as philsci
(birth day: Sep 20 1968)
live in Osaka city, Osaka, Japan.

promotions

accounts

others