From 32d13d59910a384ad09682cafc83c7300c96c694 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson
Date: Wed, 8 Mar 2017 14:46:24 +0100
Subject: erl_interface: Do not generate atoms on old latin1 ext format
Solved by letting ei_encode_atom_as ignore 'to_enc' argument
and always encode in UTF8 format.
---
lib/erl_interface/doc/src/ei.xml | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 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 ddfb4d88a8..c3c776296c 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -421,22 +421,16 @@ typedef enum {
intei_x_encode_atom_len_as(ei_x_buff* x, const char *p, int len, erlang_char_encoding from_enc, erlang_char_encoding to_enc)
Encode an atom.
- Encodes an atom in the binary format with character encoding
- to_enc
- (Latin-1 or UTF-8). Parameter p is the name of the atom with
+
Encodes an atom in the binary format. Parameter p is the name of the atom with
character encoding
from_enc
(ASCII, Latin-1, or UTF-8). The name must either be NULL-terminated or
- a function variant with a len parameter must be used.
- If to_enc is set to the bitwise OR'd combination
- (ERLANG_LATIN1|ERLANG_UTF8), UTF-8 encoding is only used if the
- atom string cannot be represented in Latin-1 encoding.
- The encoding fails if p is an invalid string in encoding
- from_enc, if the string is too long, or if it cannot be
- represented with character encoding to_enc.
- These functions were introduced in Erlang/OTP R16 as part of a first
- step to support UTF-8 atoms. Atoms encoded with ERLANG_UTF8
- cannot be decoded by earlier releases than R16.
+ a function variant with a len parameter must be used.
+ The encoding fails if p is not a valid string in encoding
+ from_enc.
+
+ Argument to_enc is ignored. As from Erlang/OTP 20 the encoding is always
+ done in UTF-8 which is readable by nodes as old as Erlang/OTP R16.
--
cgit v1.2.3