Re: Encoding Japanese characters.

"David Powers" <[email protected]>
Newsgroups gmane.comp.php.internationalization
Message-ID <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:

&#31185;&#23398;&#24525;&#32773;&#38538;&#12460;&#12483;&#12481;&#12515;
&#12510;&#12531;

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
*******************************************




-- 
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.