Is there an alternative to HTTPApp.HTMLDecode that supports '?


Is there an alternative to HTTPApp.HTMLDecode that supports '?



We have a single-page web app that records order information as XML within a database table, and a service written in Delphi XE2 which detects and processes these orders.



Generally things are fine, unless the user enters an apostrophe into the delivery address, then we get bad results as the text is truncated.



For example:


'Geoff's Liquor Sherriton'#$A'Sherriton Shopping Centre, '#$A'Shop 18B High Street, '#$A'Sherriton 1234'



Has this result:


'Geoff'#0'pos;s Liquor Sherriton'#$A'Sherriton Shopping Centre, '#$A'Shop 18B High Street, '#$A'Sherriton 1234'



Note that rather than decode the ' to a ', it decoded the &a to a #0 null character, which is totally stupid and just made things worse.


'


&a



Now, I realise that ' is not valid in HTML 4 and is actually XML encoding, but I also couldn't find anything under XML.XMLDoc that could handle it either, including XMLStringToUnicodeString, which I though would have been the perfect place to handle the decoding of XML.


'





' is part of the standard XML spec, so whatever XML processor you are using that cant handle it is not conformant and should be replaced with one that does. XHTML is designed to be processable by any conformant XML processor. Plain HTML is not.
– Remy Lebeau
Jul 2 at 1:13



'









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

How to add background colour in existing image using Swift?

Moria Casán

How to make file upload 'Required' in Contact Form 7?