Re: HTML::Entities and WinLatin1 NCRs [PATCH]

David Wheeler <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
On Mar 7, 2006, at 09:18, Gisle Aas wrote:

> Encode::decode() doesn't allow you to pass in a Unicode string with
> the gremlins in it.  This is what we had here.

Well, right. If it has the gremlins, it's not Unicode. So what is it?

> What we want is to
> convert from a string to another string, while what Encode provides is
> conversion between bytes and strings.

Yes, but if it's CP1252, you can convert it to utf8 and then to UTF-8.

> The cp1252_fixup($text) function happens to be the same as
> decode('cp1252', $text) when $text is Latin1, but not when $text is
> Unicode.

Actually, it should be the same when $text is CP1252. But where is  
the text coming from? How could it be a mix of Unicode and CP1252?

Best,

David
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.