From: Derryck W. <der...@tn...> - 2004-09-01 12:21:25
|
About the encoding, this is something i use in a web-engine: function TSpecialChars.To_XmlValue_Characters(source: wideString): UTF8String; // encode content // This function replaces the following characters //http://www.wdvl.com/Authoring/HTML/Tutorial/special_characters.html // with their respective character references: // < < // > > // ? ? // & & // ' ' // " " // [ [ // ] ] // ` ` // ! ! (**************************************** Unused � -  Horizontal Tab 	 Line Feed Unused  -  Space   ! ! " " # # $ $ % % & & ' ' ( ( ) ) * * + + , , - - . . / / 0-9 0 - 9 : : ; ; < < = = > > ? ? @ @ A - Z A - Z [ [ \ \ ] ] ^ ^ _ _ ` ` a - z a - z { { | | } } ~ ~ Unused  -   ****************************) var i,l: integer; s: UTF8String; v:integer; begin result:= ''; s:=''; if source<>'' then try l:=length(source); for i:= 1 to l do begin v:=ord(source[i]); if ( v in [33,34,38,39,60,62,91,93,96]) then s:=s+'&#'+inttostr(v)+';' else if (i=l) and (v=0) then s := s + ' ' else s := s + source[i]; end; except S:='String Exception'; end; Result:= s; end; ----- Greetings, Derryck |