From 1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 22 Jan 2013 19:25:36 +0100 Subject: erl_interface: even more utf8 atom stuff --- lib/erl_interface/doc/src/ei.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/erl_interface/doc') diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml index 0b0b1eeb79..e9c7c644b5 100644 --- a/lib/erl_interface/doc/src/ei.xml +++ b/lib/erl_interface/doc/src/ei.xml @@ -94,7 +94,11 @@ enum erlang_char_encoding { ERLANG_ASCII, ERLANG_LATIN1, ERLANG_UTF8, ERLANG_WHATEVER }; -

The character encoding used for atoms.

+

The character encoding used for atoms. ERLANG_ASCII represents 7-bit ASCII. + Latin1 and UTF8 are different extensions of 7-bit ASCII. All 7-bit ASCII characters + are valid Latin1 and UTF8 characters. ASCII and Latin1 both represent each character + by one byte. A UTF8 character can consist of one to four bytes. ERLANG_WHATEVER + is not an encoding but rather used as a wildcard.

@@ -256,11 +260,11 @@ enum erlang_char_encoding {

Encodes an atom in the binary format with character encoding to_enc (latin1 or utf8). The p parameter is the name of the atom with character encoding - from_enc. + from_enc (ascii, latin1 or utf8). The name must either be zero-terminated or a function variant with a len parameter must be used.

-

The encoding will fail if the atom is too long or if it can not be represented - with character encoding to_enc.

+

The encoding will fail if p is not a valid string in encoding from_enc, + if the string is too long or if it can not be represented with character encoding to_enc.

These functions were introduced in R16 release of Erlang/OTP as part of a first step to support UTF8 atoms. Atoms encoded with ERLANG_UTF8 can not be decoded by earlier releases than R16.

-- cgit v1.2.3