Biferno 1.7 Tabasoft.it

Application: ItaliaScuola Back-Office3
Reference
Admin | Edit | Reference | Cache | Logs
Click on a class name to see the description of that particular class:

Predefined Classes

ansi
array
biferno
boolean
cacheItem
char
classInfo
client
collection
curApp
curFile
curScript
db
double
error
file
folder
header
httpPage
imageUtils
int
long
memberInfo
multipart
object
ref
regexp
request
search
serverInfo
smtp
stackItem
string
time
unix
unsigned
 

Application Classes

Banner
BrowserBar
Ctrl_Form
FCKeditor
Form
GridChartGraph
Histogram
LocalDate
Result
condb
cookie
folderExt
headerExt
httpExt
mysqlFulltext
objHtml
requestExt
tableExport
utils
 

Functions

Functions

string

Method:

Encode

string Encode(boolean alsoCR, boolean tagsVisible, boolean entities, obj tagList)

ISO 8859-1 Format Encoding

Description:

The Encode method encodes a string according to the ISO 8859-1 format (Latin-1). More precisely, Biferno uses the ANSI character set (Windows-1252), which is an extension of the ISO 8859-1 set. E.g., the à character is encoded as à (ampersand + hash + decimal numeric code of the character + semicolon).

This encoding is necessary to be able to output special characters on a Web page, such as vowels with accents, and symbols that might otherwise not be visualized correctly by the browser (this is a potential issue on the MacOS platform).

Parameters:
alsoCR

Specifies if we want to encode new line characters with <br> tags (default: no).

tagsVisible

Indicates if we want to encode the < and > that delimit tags with &#60; and &#62; (or relative entities, default: no). This is useful, for example, if one wants to visualize a fragment of HTML code within a Web page avoiding interpretation by the browser. The < and > characters are always encoded when they are not part of a tag. The parameter tagList specifies "what is a tag"

entities

Specifies if we want that encoding is performed using the so-called HTML entities instead of numerical codes (e.g. the à character is encoded as &agrave;, instead of &#224;).

tagList

If this parameter is true all strings immediately preceeded by a "<" are considered tags. If the parameter is false are considered tag the usual HTML tags (<b>, <br>, <input> etc...).

If this parameter is an associative array, only tags matching with names of array elements are considered tag. For example, the following code:

str = "this is an <b><code>example</code></b>"
tagList = array("para":, "code":, "inlinecode":)
$str.Encode(,,, tagList)

has the result:

this is an &lt;b&gt;<code>example;</code>&lt/b&gt;

we didn't ask the tag to be visible (tagsVisible is false) but the b is encoded because it is not recognized as a tag (is not in the array). Note also that the values of the array are not relevant, relevant are their names.

Returns:

The string encoded

See also:

Decode, htmlTags, allTags

Implementation:
C
 

Return to the string class