[fpc-pascal] fpWeb and html and uri escaping/unescaping elements

Ludo Brands ludo.brands at free.fr
Wed May 25 09:33:56 CEST 2011

This is a very minimalistic implementation covering only partial ascii
character escaping. To cover ASCII only in unescapeHTML you should also add
'&nbsp' which corresponds with the space character ' '. Also the format
&#entity_number; is missing ('<' or '<' equals '<')
To support iso-8859-1 which is default in most browsers you'll need a lot
more. See f.e. http://www.w3schools.com/tags/ref_entities.asp
-----Message d'origine-----
De : fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org] De la part de ik
Envoyé : mardi 24 mai 2011 10:09
À : FPC-Pascal users discussions
Objet : Re: [fpc-pascal] fpWeb and html and uri escaping/unescaping elements

On Tue, May 24, 2011 at 00:28, ik <idokan at gmail.com> wrote:

On Tue, May 24, 2011 at 00:23, Michael Van Canneyt <michael at freepascal.org>

On Tue, 24 May 2011, ik wrote:


Does fpWeb have any method/function that escape and un-escape html and URI
elements ?


in fphttpclient:

Function EncodeURLElement(S : String) : String;
Function DecodeURLElement(Const S : String) : String;

We should maybe move them to URIParser or maybe even strutils.

I can not find any HTML encode and decode, I'll make one and open a bug with
the patches.
Where do you think it will be best to place it (I mean the unit) ?

I've created a patch with the Escape and unEscape functions, and place it
here: http://bugs.freepascal.org/view.php?id=19407





fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110525/23d31093/attachment.html>

More information about the fpc-pascal mailing list