udyog has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I have to convert following Entities.

$VAR='£¥Ü¢£áóúñÑ£';

I am using to convert those entities based on the ascii value.

Please teach me that is it right or is there any short way to convert it?

Thanks You,

Udyog

Replies are listed 'Best First'.
Re: Convert Entities
by gopalr (Priest) on Sep 23, 2005 at 14:28 UTC

    Hello

    We can Convert Entities by using "encode_entities" method in HTML::Entities Module.

    use HTML::Entities; $VAR='£¥Ü¢£áóúñÑ£'; $VAR=encode_entities($VAR); print $VAR;

    _________

    £¥Ü¢£áóúñÑ£
Re: Convert Entities
by blazar (Canon) on Sep 23, 2005 at 15:01 UTC
Re: Convert Entities
by parv (Parson) on Sep 23, 2005 at 19:43 UTC

    Besides HTML::Entities, following gives decimal entitites (easy to modify to generate hex version if desired) ...

    $entitified = join '' , map { sprintf '&#%d;' , ord $_ } split '' , $raw_string ;

    (update: slight style changes.)

Re: Convert Entities
by planetscape (Chancellor) on Sep 23, 2005 at 21:43 UTC
Re: Convert Entities
by Anonymous Monk on Sep 23, 2005 at 14:27 UTC
    Those characters don't exist in ASCII.