# Method unicode_to_string()

Method unicode_to_string

  ``string` unicode_to_string(`string(8bit)` `s`, `int(0..2)`|`void` `byteorder`)`

Description

  Converts an UTF16 byte-stream into a string.

Parameter `s`

  String to convert to UTF16.

Parameter `byteorder`

  Default input byte-order. One of:

  ``0`` | Network (aka big-endian) byte-order (default).
  ``1`` | Little-endian byte-order.
  ``2`` | Native byte-order.

  Note that this argument is disregarded if `s` starts with a BOM.

Note

  This function did not decode surrogates in Pike 7.2 and earlier.

See also

  Charset.decoder(), string_to_unicode(), string_to_utf8(), utf8_to_string()