constant
Library: UTF-8 (OMUTF8)
Import : omutf8.xmd |
Returns: the UTF-8 byte-order mark |
export constant string byte-order-mark
Use utf8.byte-order-mark
to match a UTF-8 byte-order mark sequence. Since this byte-order mark can
interfere with later processing, it is sometimes better to remove it from the input. For example, since a UTF-8
byte-order mark can interfere with XML processing, it can be dropped from the input before the latter is passed to
the XML parser.
The following example uses utf8.byte-order-mark
to remove a leading byte-order mark from the file
input.xml
before processing it with the XML parser:
import "omutf8.xmd" prefixed by utf8. process do xml-parse scan file "input.xml" drop utf8.byte-order-mark? suppress done
To use utf8.byte-order-mark
, you must import OMUTF8 into your program
using an import declaration such as:
import "omutf8.xmd" prefixed by utf8.