]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/io/encodings/utf32/utf32.factor
use radix literals
[factor.git] / basis / io / encodings / utf32 / utf32.factor
index 1eaccb3e6bb6c8e87db78cd482020c6e40f346a6..e609738ff68e0bee0c07130e5ed829971940b2ab 100644 (file)
@@ -1,15 +1,21 @@
 ! 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
@@ -40,9 +46,9 @@ M: utf32le encode-char
 
 ! UTF-32
 
-: bom-le B{ HEX: ff HEX: fe 0 0 } ; inline
+CONSTANT: bom-le B{ 0xff 0xfe 0 0 }
 
-: bom-be B{ 0 0 HEX: fe HEX: ff } ; inline
+CONSTANT: bom-be B{ 0 0 0xfe 0xff }
 
 : bom>le/be ( bom -- le/be )
     dup bom-le sequence= [ drop utf32le ] [