www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
xmlagg
xmlattributes
xmladdattribute
xmlappendchildren
xmlconcat
xmlelement
xmlforest
xmlinsertafter
xmlinsertbefore
xmlreplace
xmltype.xmltype
xmltype.createnonsch...
xmltype.createschema...
xmltype.createxml
xmltype.existsnode
xmltype.extract
xmltype.getclobval
xmltype.getnamespace
xmltype.getnumval
xmltype.getrooteleme...
xmltype.getschemaurl
xmltype.getstringval
xmltype.isfragment
xmltype.isschemabase...
xmltype.isschemavali...
xmltype.isschemavali...
xmltype.schemavalida...
xmltype.setschemaval...
xmltype.toobject
xmltype.transform
xmlupdate
xper navigation
createxml
isentity
serialize_to_utf8_xm...
tidy_html
tidy_list_errors
updatexml
xml_add_system_path
xml_auto
xml_auto_dtd
xml_auto_schema
xml_create_tables_fr...
xml_cut
xml_doc_output_optio...
xml_get_system_paths
xml_load_mapping_sch...
xml_load_schema_decl
xml_namespace_scope
xml_persistent
xml_template
xml_tree
xml_tree_doc
xml_tree_doc_media_t...
xml_uri_get
xml_validate_dtd
xml_validate_schema
xml_view_dtd
xml_view_schema
xmlsql_update
xpath_eval
xper_cut
xper_doc
xper_locate_words
xpf_extension
xpf_extension_remove
xquery_eval
xslt
xslt_format_number
xslt_sheet
xslt_stale
xte_head
xte_node
xte_node_from_nodebl...
xte_nodebld_acc
xte_nodebld_final
xte_nodebld_init
xtree_doc
XPATH & XQUERY

Functions Index

serialize_to_UTF8_xml

Converts argument to its UTF-8 string representation.
serialize_to_UTF8_xml (in value any);
Description

The function converts its argument to a narrow string in UTF-8 encoding. The way conversion is done depends on the type of the argument.

If value is a wide (national) string or a LONG NVARCHAR then it is directly converted to UTF-8 string.

If value is a string or a LONG VARCHAR then it is converted from current charset of client connection to the UTF-8.

If value is an XML entity then it is converted to its XML text representation in UTF-8 encoding. The resulting string is a well-formed XML document if the given entity is an element entity, otherwise it may be well-formed generic entity, i.e. it can be parsed by an XML parser only as a part of some other XML document.

If value is NULL, the NULL is returned.

Values of other types are first converted to VARCHAR, this intermediated VARCHAR is converted from current charset of client connection to the UTF-8 and is returned.

Parameters
value – The value of arbitrary type to be converted into its UTF-8 string representation.
Return Types

UTF-8 string or NULL.

Examples
UTF-8 encoding of non-ASCII characters

A sample document is parsed and the resulting entity is serialized to UTF-8 string.

select serialize_to_UTF8_xml(xtree_doc('<text>0-9 a-z A-Z &#128;-&#255; &#256;-&#511; &#1024;-&#8191;</text>'));
callret
VARCHAR
_______________________________________________________________________________

<text>0-9 a-z A-Z €-ÿ Ā-ǿ Ѐ-῿</text>
See Also

charset_recode