summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Frantzen <71122361+frazze-jobb@users.noreply.github.com>2023-05-12 11:10:11 +0200
committerGitHub <noreply@github.com>2023-05-12 11:10:11 +0200
commit198c32b7b96285193b20ef64770ddd566ec53d45 (patch)
treedffd9f3b6667f57cf66872819b028678ccc97bae
parent16139b6a35944583b4f1ef05c7698bfe2f771c7a (diff)
parent0b62acd9868ac597749650c837618fcc5a18f832 (diff)
downloaderlang-198c32b7b96285193b20ef64770ddd566ec53d45.tar.gz
Merge pull request #7225 from frazze-jobb/frazze/kernel/escript_doc_raw_bytes
stdlib: update doc regarding escript raw bytes incompatibility OTP-17932
-rw-r--r--erts/doc/src/escript_cmd.xml5
-rw-r--r--lib/stdlib/doc/src/io.xml9
2 files changed, 12 insertions, 2 deletions
diff --git a/erts/doc/src/escript_cmd.xml b/erts/doc/src/escript_cmd.xml
index 78b121ee97..06c245006b 100644
--- a/erts/doc/src/escript_cmd.xml
+++ b/erts/doc/src/escript_cmd.xml
@@ -118,9 +118,10 @@ $ <input>escript factorial 5</input></pre>
applies to the script itself. The encoding of the
I/O-server, however, must be set explicitly as follows:</p>
<code>
-io:setopts([{encoding, unicode}])</code>
+io:setopts([{encoding, latin1}])</code>
<p>The default encoding of the I/O-server for <c>standard_io</c>
- is <c>latin1</c>, as the script runs in a non-interactive terminal
+ is <c>unicode</c> if its supported, as the script runs in a
+ non-interactive terminal.
(see section
<seeguide marker="stdlib:unicode_usage#unicode_options_summary">
Summary of Options</seeguide>) in the STDLIB User's Guide.</p>
diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml
index a1c467ca1c..2a25163e3a 100644
--- a/lib/stdlib/doc/src/io.xml
+++ b/lib/stdlib/doc/src/io.xml
@@ -1157,6 +1157,15 @@ enter><input>1.0er.</input>
<p>This option is supported by the standard shell
(<c>group.erl</c>), the 'oldshell' (<c>user.erl</c>), and the
file I/O servers.</p>
+ <note>
+ Since OTP 26 <c>user.erl</c> has been deprecated, all I/O is now passed
+ through <c>group.erl</c>. I/O defaults to unicode if its supported, otherwise
+ latin1 (0-127), all text is however converted to unicode as an intermediate
+ representation. This means that 128-255 will be converted to unicode.
+ If you have an escript that sends raw bytes on standard_io, those bytes
+ will be translated to unicode and then back to latin1.
+ To avoid this, set the encoding to latin1.
+ </note>
</item>
<tag><c>{echo, boolean()}</c></tag>
<item>