From d6e3e256b850050b7a86323b2948009d5fcc30a9 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 23 Jan 2013 10:17:29 +0100 Subject: erl_interface: Fix bug when transcoding atoms from and to UTF8 --- lib/erl_interface/src/decode/decode_atom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/erl_interface/src/decode/decode_atom.c b/lib/erl_interface/src/decode/decode_atom.c index 556c400cb3..9779ad3f35 100644 --- a/lib/erl_interface/src/decode/decode_atom.c +++ b/lib/erl_interface/src/decode/decode_atom.c @@ -76,8 +76,8 @@ int ei_decode_atom_as(const char *buf, int *index, char* p, int destlen, } else { int plen = (got_enc == ERLANG_LATIN1) ? - utf8_to_latin1(p, s, len, destlen-1, res_encp) : - latin1_to_utf8(p, s, len, destlen-1, res_encp); + latin1_to_utf8(p, s, len, destlen-1, res_encp) : + utf8_to_latin1(p, s, len, destlen-1, res_encp); if (plen < 0) return -1; if (p) p[plen] = 0; } -- cgit v1.2.3