This is a very minimalistic implementation covering only partial ascii character escaping. To cover ASCII only in unescapeHTML you should also add ' ' 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 Ludo -----Message d'origine----- De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@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 <ido...@gmail.com> wrote: On Tue, May 24, 2011 at 00:23, Michael Van Canneyt <mich...@freepascal.org> wrote: On Tue, 24 May 2011, ik wrote: Hello, Does fpWeb have any method/function that escape and un-escape html and URI elements ? Yes. 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 Michael. Thanks, Ido _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal