| htmlEncode |
(String str [, String extra]) |
yoix.string |
| |
Translates each character in
str
into a character or character encoding suitable for HTML.
In essence, all printable ASCII characters and the newline and carriage
return characters pass through unchanged with
the exception of the less than, greater than, ampersand and double quote
characters.
All characters that are not passed through unchanged are converted into the form
N;,
where
N
is the decimal value of the character.
The optional
extra
argument, if it is supplied and not
NULL,
is a collection of additional characters that will be automatically encoded in
this format.
| |
| Example: |
The program,
import yoix.string.*;
String text = "<B>Hello, World.</B>";
stdout.nextline = text;
stdout.nextline = htmlEncode(text);
stdout.nextline = htmlDecode(htmlEncode(text));
stdout.nextline = htmlEncode(text, "ro");
stdout.nextline = htmlDecode(htmlEncode(text, "ro"));
prints
<B>Hello, World.</B>
<B>Hello, World.</B>
<B>Hello, World.</B>
<B>Hello, World.</B>
<B>Hello, World.</B>
on standard output.
| | |
| Return: |
String
| | |
| See Also: |
htmlDecode
|
|
Yoix is a registered trademark of AT&T Inc.
|