YamlUnicodeReader

class YamlUnicodeReader(source: Source) : Source

Generic unicode text reader, which will use BOM mark to identify the encoding to be used. If BOM is not found then use a given default or system encoding.

version: 1.1 / 2007-01-25 - changed BOM recognition ordering (longer boms first)

Original pseudocode : Thomas Weidenfeller Implementation tweaked: Aki Nieminen Implementation changed: Andrey Somov no default encoding must be provided - UTF-8 is used by default (http://www.yaml.org/spec/1.2/spec.html#id2771184)

http://www.unicode.org/unicode/faq/utf_bom.html BOMs:

  • 00 00 FE FF = UTF-32, big-endian

  • FF FE 00 00 = UTF-32, little-endian

  • FE FF = UTF-16, big-endian

  • FF FE = UTF-16, little-endian

  • EF BB BF = UTF-8

Win2k Notepad: Unicode format = UTF-16LE

Parameters

source

Source to be read

Constructors

Link copied to clipboard
constructor(source: Source)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

the name of the character encoding being used by this stream.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun read(sink: Buffer, byteCount: Long): Long
Link copied to clipboard
Link copied to clipboard
open override fun timeout(): Timeout