Yaml Unicode Reader
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-endianFF FE 00 00
= UTF-32, little-endianFE FF
= UTF-16, big-endianFF FE
= UTF-16, little-endianEF BB BF
= UTF-8
Win2k Notepad: Unicode format = UTF-16LE
Parameters
source
Source to be read