! Copyright (C) 2009 Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
USING: math kernel io.encodings combinators io io.encodings.utf16
-sequences io.binary ;
+sequences io.binary io.encodings.iana ;
IN: io.encodings.utf32
SINGLETON: utf32be
+utf32be "UTF-32BE" register-encoding
+
SINGLETON: utf32le
+utf32le "UTF-32LE" register-encoding
+
SINGLETON: utf32
+utf32 "UTF-32" register-encoding
+
<PRIVATE
! Decoding
! UTF-32
-CONSTANT: bom-le B{ HEX: ff HEX: fe 0 0 }
+CONSTANT: bom-le B{ 0xff 0xfe 0 0 }
-CONSTANT: bom-be B{ 0 0 HEX: fe HEX: ff }
+CONSTANT: bom-be B{ 0 0 0xfe 0xff }
: bom>le/be ( bom -- le/be )
dup bom-le sequence= [ drop utf32le ] [