[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] HTML Character Conversion



On 12/19/98 9:10 PM, Chris Nandor (pudge@pobox.com) wrote:

> Look at HTML::Entities.  That might do it.

Hmmm..., well, I gave it a shot:

     use HTML::Entities;
     $output_line = encode_entities($input_line);

This code translated the character  to the code , while the BBEdit 
Format tool translates the same character to the code ù.

Only the latter code, ù renders the proper character in Netscape. 
The former code,  and the one returned by HTML::Entities renders as 
no specific character in Netscape.

Interestingly, 157 is the ASCII decimal code for , while 249 is the HTML 
decimal code for the same character. I'm just learning Perl, so I 
couldn't fully follow the Entities.pm code that well, but is seems that 
the encoding uses the chr() function, which I suppose returns the decimal 
ASCII code for the character. How could it be modified to return the HTML 
code? (And why are they different?)

Any ideas?

Thanks,

Matt Henderson   |   matt@exponet.net   |    www.exponet.net
                 .                      .    
E x p o n e t   M e d i a  T e c h n o l o g i e s   G m b H
Full-Service Web Development & Engineering Services Provider


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch