Sitemap Sitemap  |  Contact Us Contact Us  |  Clients Clients
   EncodeHTML
  Home |  WebHare Lite |  Downloads |  HareScript |  Websites/CMS |  Applications
Search for:  in: 
HareScript
General functions
 
Base functions
Cryptography APIs
Date and time manipulation
Developers support
Mathematic and floating point utility functions
Money type utility functions
EncodeHTML
  Converts special characters to HTML entities.
 
Syntax PUBLIC STRING FUNCTION EncodeHTML (STRING text)
 
Description Certain characters have special significance in HTML, and should be represented by HTML entities if they are to
preserve their meanings. EncodeHTML returns string with these conversions made.

The function is useful to prevent user-supplied text from containing HTML markup. It will translate
any character outside the printable ASCII character set, and all dangerous characters (<, >, &),
into a HTML entitity.

The function resembles EncodeValue, with the exception that it translates linebreaks
into <br> tags, as opposed to &#10; entities
 
Parameters
text String to encode
 
Returns The encoded string
 
Example
// returns "&#60;HTML&#62;"
STRING example1 := EncodeHTML("<HTML>");

// returns "Johnny <br /> Jane"
STRING example2 := EncodeHTML("Johnny \n Jane");

// returns a link with the proper encoded url and text for the file
// with ID=1.
RECORD file := FindFile(1);
PRINT('<a href="' || EncodeValue(file.url) || '">'
|| EncodeHTML(file.title) || '</a>');
 
In library 'system'
Abort
Abs
AnyToString
Avg
BindSchemaToTable
BindTransactionToSchema
BindTransactionToTable
ByteToString
CellDelete
CellExists
CellInsert
CellUpdate
CollectGarbage
Count
DecodeBase16
DecodeBase64
DecodeCharSet
DecodeHTML
DecodeJava
DecodePacket
DecodeURL
DecodeValue
Detokenize
EncodeBase16
EncodeBase64
EncodeCharSet
EncodeHTML
EncodeJava
EncodePacket
EncodeURL
EncodeValue
ExtendObject
GetBestCharacterSet
GetBoundTransactionFromSchema
GetBoundTransactionFromTable
GetByteValue
GetCell
GetUCValue
GroupedValues
IsAtEndOfStream
IsPrintableASCII
IsPrivilegeGranted
IsTypeidArray
IsTypeidComparable
IsValidUTF8
Left
Length
MakeEmptyRecord
MakeObject
Max
MemberExists
Min
ObjectExists
Print
PrintRecordArrayTo
PrintRecordTo
PrintTo
Random
ReadFrom
ReadLineFrom
RecordExists
RedirectOutputTo
Right
SearchElement
SearchLastElement
SearchLastSubstring
SearchSubstring
SeedRandomizer
SendBlobTo
Substitute
Substring
Sum
ToInteger
Tokenize
ToLowercase
ToString
ToUppercase
TrimWhitespace
UCLeft
UCLength
UCRight
UCSearchLastSubstring
UCSearchSubstring
UCSubstring
UCToString
UCTruncate
UnpackRecord
WaitForMultiple
 
Top To top of page