utf16.reader

function

Library: UTF-16 (OMFFUTF16)
Import : omffutf16.xmd

Returns: a scannable input source for streaming data


Declaration
export external string source function 
   reader from value string source input-data


Purpose

Use utf16.reader to read its value string source input-data argument and return the data converted from a UTF-16 encoding to a UTF-8 encoding. That is, the provided source is in UTF-16, but the program sees UTF-8.

Example

The following example converts the file named by the first command-line argument to the file named by the second command-line argument, converting from UTF-16 encoding to UTF-8 encoding the output file.

  import "omffutf16.xmd" prefixed by utf16.
  
  process
     set file #args[2] to utf16.reader from file #args[1]

Usage Note

To use utf16.reader, you must import OMFFUTF16 into your program using an import declaration such as:

  import "omffutf16.xmd" prefixed by utf16.

Other Library Functions