[erlang-questions] cookbook entry #1 - unicode/UTF-8 strings

Michael Uvarov freeakk@REDACTED
Thu Oct 20 15:58:41 CEST 2011


We can use BOM.
http://unicode.org/faq/utf_bom.html

<code>
UTF8List = [16#EF, 16#BB, 16#BF, 49,48,226,130,172].
AsciiList = "abc".
UnicodeList = [16#FEFF, 49,48,8364].
UTF8Binary = <<16#EF, 16#BB, 16#BF, 49,48,226,130,172>>.
UTF16LEBinary = <<16#FF, 16#FE, 49,0,48,0,172,32>>.
UTF16BEBinary = <<16#FE, 16#FF, 0,49,0,48,32,172>>.
</code>



More information about the erlang-questions mailing list