From 685d009efcfd7521e9c918a14b58eac19755299d Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 21 Dec 2012 15:50:21 +0100 Subject: erl_interface: Enable decode of unicode atoms No API changes or additions. Just the ability for erl_interface to decode unicode atoms and convert them into latin1 strings to preserve backward compatibility for the existing API. --- lib/erl_interface/src/misc/get_type.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/erl_interface/src/misc/get_type.c') diff --git a/lib/erl_interface/src/misc/get_type.c b/lib/erl_interface/src/misc/get_type.c index 2a680d0f94..c9a040fbbd 100644 --- a/lib/erl_interface/src/misc/get_type.c +++ b/lib/erl_interface/src/misc/get_type.c @@ -55,10 +55,12 @@ int ei_get_type(const char *buf, const int *index, int *type, int *len) break; case ERL_SMALL_TUPLE_EXT: + case ERL_SMALL_ATOM_EXT: *len = get8(s); break; case ERL_ATOM_EXT: + case ERL_UNICODE_ATOM_EXT: case ERL_STRING_EXT: *len = get16be(s); break; @@ -114,10 +116,14 @@ int ei_get_type_internal(const char *buf, const int *index, *type = get8(s); switch (*type) { + case ERL_SMALL_ATOM_EXT: + *type = ERL_ATOM_EXT; case ERL_SMALL_TUPLE_EXT: *len = get8(s); break; - + + case ERL_UNICODE_ATOM_EXT: + *type = ERL_ATOM_EXT; case ERL_ATOM_EXT: case ERL_STRING_EXT: *len = get16be(s); -- cgit v1.2.3