# What is the string encoding used for \`FLOAT\_EXT\` in the Erlang term format?

**URL:** <https://erlangforums.com/t/what-is-the-string-encoding-used-for-float-ext-in-the-erlang-term-format/1946>\
**Category:** Questions / Help\
**Tags:** erlang\
**Created:** [October 16, 2022, 5:48am UTC](https://erlangforums.com/t/what-is-the-string-encoding-used-for-float-ext-in-the-erlang-term-format/1946 "2022-10-16T05:48:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmitc](https://erlangforums.com/user_avatar/erlangforums.com/bmitc/32/1720_2.png) [@bmitc](https://erlangforums.com/u/bmitc)\
**Post date:** [October 16, 2022, 5:48am UTC](https://erlangforums.com/t/what-is-the-string-encoding-used-for-float-ext-in-the-erlang-term-format/1946/1 "2022-10-16T05:48:06Z")

</div>

In the [documentation for the External Term Format](https://www.erlang.org/docs/25/apps/erts/erl_ext_dist.html#float_ext), `FLOAT_EXT` is described as:

> A finite float (i.e. not inf, -inf or NaN) is stored in string format. The format used in sprintf to format the float is “%.20e” (there are more bytes allocated than necessary). To unpack the float, use sscanf with format “%lf”.

What is the string encoding used to encode the string? Is it ASCII? Latin-1? UTF-8? I am guessing that maybe it doesn’t matter since the string should only consist of numbers, `.`, `+`, and `e`, and I further assume these characters have the same byte representation across ASCII, Latin-1, and UTF-8 (that is an assumption and guess, I haven’t checked it). But does anyone know?

---

<div class="post-metadata">

**Author:** ![bjorng](https://erlangforums.com/user_avatar/erlangforums.com/bjorng/32/174_2.png) [@bjorng](https://erlangforums.com/u/bjorng)\
**Post date:** [October 16, 2022, 9:13am UTC](https://erlangforums.com/t/what-is-the-string-encoding-used-for-float-ext-in-the-erlang-term-format/1946/2 "2022-10-16T09:13:46Z")

</div>

Yes, you are correct. I doesn’t matter.

Furthermore, as the documentation says, `FLOAT_EXT` has been superseded by `NEW_FLOAT_EXT`.

---

<div class="post-metadata">

**Author:** ![bmitc](https://erlangforums.com/user_avatar/erlangforums.com/bmitc/32/1720_2.png) [@bmitc](https://erlangforums.com/u/bmitc)\
**Post date:** [October 16, 2022, 9:45am UTC](https://erlangforums.com/t/what-is-the-string-encoding-used-for-float-ext-in-the-erlang-term-format/1946/3 "2022-10-16T09:45:53Z")

</div>

Thank you @bjorng! I will just use ASCII to do the decoding in this case.

And yes, I saw the note that `NEW_FLOAT_EXT` superseded it. However, I am writing an encoding/decoding library for the Erlang term format in another language, and I was trying to support as much of the tags/forms as possible, at least for decoding.
