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

Re: [MacPerl] HTML Entities decoding




On Tue, 14 Sep 1999, Simply Hao wrote:

> 151 on MacOS is an accented o.  Anything above 127 is unpredictable,
> and HTML::Entities makes a half-hearted attempt with:
> 
>     s/(&\#(\d+);?)/$2 < 256 ? chr($2) : $1/eg;
> 
> Do you want to patch HTML::Entities and add numeric entities?  :)


Let's back up one question...Do I think HTML::Entities should be patched
to reflect a sort of de facto (old) browser standard?  Yes.  Now, do _I_
want to patch it?  If it didn't involve rediscovering what someone else
probably has readily available, I would.  I may still, but it seems like
False Laziness or False Impatience or False Hubris.  (See Ch. 5 of
Programming Perl.)


Chris Nandor wrote:
> It has to do with character encodings.  I'd bet that HTML::Entities is
> using ISO Latin 1.  Most Mac fonts use MacRoman.  You'd need a
> MacRoman<->Latin1 translation table.

I don't know how to respond to this. :)  This Roman<->Latin1 table might
be what I want/need, and might be just the thing to patch HTML::Entities
on the Mac.  Anybody have a link to such a table?

John Baxter wrote:
> The numeric entities from 128 through 159 remain nonstandard (the easy
> thing to do is just covert them to the byte of that value, and since
> they are nonstandard, that can't be "wrong," just not very useful).

It isn't wrong by (that) standard, but for communicating a specific
character, it could be misleading.  As you say, this is not exactly
wrong--but it may give different results from both web browsers on the
Mac, and may not ever reflect the char intended by the publisher.

If I can discover what was intended, and if there is some consensus on
what should be shown, I might patch.  Otherwise, I'll duct tape it with my
own ad hoc conversions.  

Thanks to all for the quick and informative responses.  This group is
great!


--
MattLangford 








===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org