"He Zhiqiang" <[EMAIL PROTECTED]> writes:

> Hi list: I've a problem to convert a unicode character into it's
> decimal or Hexadecimal value. The following URL:
> http://code.cside.com/3rdpage/us/unicode/converter.html
>  can easily convert via Javascript function escape(), but i wonder
> that is there some method or function
> or modules can do the same job??

I think encode_entities_numeric() from HTML::Entities will do.

>   If i can do it, then in one html
> page, i can display ont only chinese, but
> also japanese, korea etc... This is something like HTML unicode, am i
> right? The ord() function can't do the job because it return the
> incorrect decimal value. perhaps i do not describe
> this question clearly, and hope all can excuse me :)

You can format the result of ord() as hex using perl's sprintf()
function.

Regards,
Gisle

Reply via email to