Re: ISO-8859-1 to ASCII conversion?

Giganews Newsgroups
Subject: Re: ISO-8859-1 to ASCII conversion?
Posted by:  Remy Lebeau (Indy Team) (no.spam@no.spam.com)
Date: Thu, 22 Mar 2007

"Christian Gorski" <no.spam@no.spam.com> wrote in message
news:82AA96EA7E1FE340no.spam@no.spam.com...

> Is there a function which converts ISO-8859-1 to ASCII (&#65533; ->
#0)?

ISO-8859-1 is already in ASCII format.  There is nothing to convert.
What you are asking for has nothing to do with converting ISO-8859-1
itself.  You are asking for an entity decoder instead.  That is a very
different issue.

Simply parse out the substring between the '&' and ';' characters.  If
the substring begins with '#' then strip it off and pass the rest to
StrToInt().  You can then look up the resulting Integer in the
Character set for the document to retreive the original character.  If
the substring does not begin with '#', then you will have to look up
the value in the list of known entity names, as defined by the various
HTML and XML standards.

Gambit

Replies

None

In response to

ISO-8859-1 to ASCII conversion? posted by Christian Gorski on Thu, 22 Mar 2007