diff options
author | Sverker Eriksson <[email protected]> | 2013-01-22 19:25:36 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-01-22 19:34:03 +0100 |
commit | 1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1 (patch) | |
tree | bf152c1b3dbf855dfc5a8724c3e043e161a971b6 /lib/erl_interface/src/prog | |
parent | 8eb544073fe243a8935a54f83f9c9f1f7478e3c5 (diff) | |
download | otp-1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1.tar.gz otp-1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1.tar.bz2 otp-1f4765cca4874fa92fcfad888fbe6d5f2fbf74d1.zip |
erl_interface: even more utf8 atom stuff
Diffstat (limited to 'lib/erl_interface/src/prog')
-rw-r--r-- | lib/erl_interface/src/prog/ei_fake_prog.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/erl_interface/src/prog/ei_fake_prog.c b/lib/erl_interface/src/prog/ei_fake_prog.c index 68eb537211..34101a2851 100644 --- a/lib/erl_interface/src/prog/ei_fake_prog.c +++ b/lib/erl_interface/src/prog/ei_fake_prog.c @@ -96,6 +96,7 @@ int main(void) EI_ULONGLONG *ulonglongp = (EI_ULONGLONG*)NULL; EI_ULONGLONG ulonglongx = 0; #endif + enum erlang_char_encoding enc; intx = erl_errno; @@ -148,9 +149,13 @@ int main(void) ei_x_encode_string(&eix, charp); ei_x_encode_string_len(&eix, charp, intx); ei_encode_atom(charp, intp, charp); + ei_encode_atom_as(charp, intp, charp, ERLANG_LATIN1, ERLANG_UTF8); ei_encode_atom_len(charp, intp, charp, intx); + ei_encode_atom_len_as(charp, intp, charp, intx, ERLANG_ASCII, ERLANG_LATIN1); ei_x_encode_atom(&eix, charp); + ei_x_encode_atom_as(&eix, charp, ERLANG_LATIN1, ERLANG_UTF8); ei_x_encode_atom_len(&eix, charp, intx); + ei_x_encode_atom_len_as(&eix, charp, intx, ERLANG_LATIN1, ERLANG_UTF8); ei_encode_binary(charp, intp, (void *)0, longx); ei_x_encode_binary(&eix, (void*)0, intx); ei_encode_pid(charp, intp, &epid); @@ -181,6 +186,7 @@ int main(void) ei_decode_char(charp, intp, charp); ei_decode_string(charp, intp, charp); ei_decode_atom(charp, intp, charp); + ei_decode_atom_as(charp, intp, charp, MAXATOMLEN_UTF8, ERLANG_WHATEVER, &enc, &enc); ei_decode_binary(charp, intp, (void *)0, longp); ei_decode_fun(charp, intp, &efun); free_fun(&efun); |