AtomVM icon indicating copy to clipboard operation
AtomVM copied to clipboard

Encode all atoms in UTF-8

Open fadushin opened this issue 2 years ago • 0 comments

As of OTP-26, all atoms are encoded in UTF-8 when using term_to_binary/1.

For simplicity of maintenance, we should adopt this behavior, as well. This will also provide better interoperability with other VMs, as externalized atoms are also encoded in UTF-8.

Encoding atoms in UTF-8 may have an impact on backwards compatibility, in the event that previously encoded atoms are persisted somewhere (e.g., NVS). The probability that this is the case in a project at this level of maturity is vanishingly 0, but we may want to optionally consider supporting the minor_version option in the term_to_binary/2 Nif.

C.f., https://www.erlang.org/doc/apps/erts/erl_ext_dist#encoding-atoms https://www.erlang.org/doc/man/erlang#term_to_binary-2

fadushin avatar Dec 30 '23 18:12 fadushin