%% %CopyrightBegin%
%%
%% SPDX-License-Identifier: Apache-2.0
%%
%% Copyright Ericsson AB 2021-2025. All Rights Reserved.
%%
%% %CopyrightEnd%

[;1m  binary_to_atom(Binary)[0m

[;;4mSince[0m:
  OTP 23.0

  There is no documentation for binary_to_atom(Binary, utf8)

[;1m  binary_to_atom(Binary, Encoding)[0m

  Returns the atom whose text representation is [;;4mBinary[0m. If [;;4m[0m
  [;;4mEncoding[0m is [;;4mutf8[0m or [;;4municode[0m, the binary must contain valid
  UTF-8 sequences.

  [;;4mChange[0m

    As from Erlang/OTP 20, [;;4mbinary_to_atom(Binary, utf8)[0m is
    capable of decoding any Unicode character. Earlier versions
    would fail if the binary contained Unicode characters > 255.

  [;;4mNote[0m

    The number of characters that are permitted in an atom name is
    limited. The default limits can be found in the Efficiency
    Guide (section System Limits).

  [;;4mNote[0m

    There is configurable limit on how many atoms that can exist
    and atoms are not garbage collected. Therefore, it is
    recommended to consider whether [;;4mbinary_to_existing_atom/2[0m is
    a better option than [;;4mbinary_to_atom/2[0m. The default limits
    can be found in Efficiency Guide (section System Limits).

  Examples:

    > binary_to_atom(<<"Erlang">>, latin1).
    'Erlang'

    > binary_to_atom(<<1024/utf8>>, utf8).
    'Ѐ'
