StringTools
EncodeEntities
convert UTF-8 special characters to HTML entities in a string
Calling Sequence
Parameters
Description
Examples
Compatibility
EncodeEntities( s )
s
-
string; Maple string
The EncodeEntities(s) command converts UTF-8 special characters in the input string s to HTML entities.
The conversion always uses the hex code form of an entity even when a named entity exists. For example, the pi character will be converted to "π" rather than "π". The form argument defaults to xml, which specifies
This command only deals with UTF-8 to Unicode conversions, and does not look at escaping one-byte characters like angle brackets. The StringTools:-Escape command handles this conversion if needed.
withStringTools:
r≔DecodeEntitiesエンコード
r≔エンコード
r≔EncodeEntitiesr:lprintr
"エンコード"
pichar≔DecodeEntitiesπ
pichar≔π
r≔EncodeEntitiescatIs ,pichar, > 3.14:lprintr
"Is π > 3.14"
The StringTools[EncodeEntities] command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
See Also
StringTools[DecodeEntities]
StringTools[Escape]
Download Help Document