Re: Encoding Japanese characters.
| From: | Inwards | Date: | Wed, 30 Jul 2003 23:29:22 +0000 |
| Subject: | Re: Encoding Japanese characters. | ||
| References: | 1 2 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-595@lists.php.net to get a copy of this message | ||
Thanks for the quick response. I suppose that I did not make myself very
clear. I realize that this page's solution is to convert to unicode
numerical values. Since I want to do something very similar to this
particular page (ie; I happen to have the Japanese name of something that I
would like to display, but the rest of the page is entirely English), this
seems to be the best solution.
What I can't seem to figure out is how to get the unicode value for a
multibyte character. I guess that I'm looking for the mb equivalent of
ord(). Any ideas? Or is there a better/smarter way to accomplish what I'm
after?
"David Powers" <david.powers@dial.pipex.com> wrote in message
news:007b01c356ef$e8148fe0$0101a8c0@dan...
> Inwards wrote:
> >
> > - I have a string containing a Japanese phrase. mb_detect_encoding()
> > reports it as SJIS.
> > - I want to display this string in HTML without changing the encoding
> > type (ISO-8859-1).
>
> You can't. If you want to support Japanese in a web page, you have to
> use an encoding that supports Japanese - UTF-8, Shift_JIS, EUC-JP, for
> example.
>
> > - In order to accomplish this, I would like to encode the text as
> > Unicode values. I have seen a nice example of this in action here:
> >
> > http://www.animenewsnetwork.com/encyclopedia/anime.php?id=4 so I
> > know
> > that it is possible.
>
> That page doesn't use Japanese, but HTML numeric entities:
>
>
> 科学忍者隊ガッチャ
> マン
>
> You need to find a method of converting Japanese to numeric entities if
> that's the route you want to take. I have had it happen to me by
> accident, but for anyone who can read Japanese, it's a complete
> nightmare to work with, so it's unlikely to be a function in great
> demand.
>
> David Powers
> *******************************************
> No-nonsense reviews of computer books
> http://japan-interface.co.uk/webdesign/books.html
> Save 10% on TopStyle CSS Editor
> *******************************************
>
>
>