diff options
author | Hans Bolinder <[email protected]> | 2013-02-15 13:23:27 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2013-02-15 13:23:27 +0100 |
commit | f7095c4c3ac256f2d587475d11a1cd09f9454a76 (patch) | |
tree | bcd95ee1d2e39fad2db67b1912e23c22fa3aade5 /lib/stdlib/doc/src | |
parent | 0d77170a3f0e537d103d83f28ae09977d6e95fb8 (diff) | |
parent | 22e3a1c772041cbb3a137a87436bf8b304c8499f (diff) | |
download | otp-f7095c4c3ac256f2d587475d11a1cd09f9454a76.tar.gz otp-f7095c4c3ac256f2d587475d11a1cd09f9454a76.tar.bz2 otp-f7095c4c3ac256f2d587475d11a1cd09f9454a76.zip |
Merge branch 'hb/stdlib/unicode_corrections/OTP-10820'
* hb/stdlib/unicode_corrections/OTP-10820:
[stdlib] Add documentation of ~tp
[stdlib] Correct handling of Unicode filenames
Diffstat (limited to 'lib/stdlib/doc/src')
-rw-r--r-- | lib/stdlib/doc/src/io.xml | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml index 9f59fda6b5..63f814ad2e 100644 --- a/lib/stdlib/doc/src/io.xml +++ b/lib/stdlib/doc/src/io.xml @@ -494,8 +494,9 @@ ok <c>~w</c>, but breaks terms whose printed representation is longer than one line into many lines and indents each line sensibly. It also tries to detect lists of - printable characters and to output these as strings. - For example:</p> + printable characters and to output these as strings. The + Unicode translation modifier is used for determining + what characters are printable. For example:</p> <pre> 1> <input>T = [{attributes,[[{id,age,1.50000},{mode,explicit},</input> <input>{typename,"INTEGER"}], [{id,cho},{mode,explicit},{typename,'Cho'}]]},</input> @@ -546,6 +547,19 @@ ok [{a,[97]}, {b,[98]}] ok</pre> + <p>Binaries that look like UTF-8 encoded strings will be + output with the string syntax if the Unicode translation + modifier is given:</p> + <pre> +9> <input>io:fwrite("~p~n",[[1024]]).</input> +[1024] +10> <input>io:fwrite("~tp~n",[[1024]]).</input> +"\x{400}" +11> <input>io:fwrite("~tp~n", [<<128,128>>]).</input> +<<128,128>> +12> <input>io:fwrite("~tp~n", [<<208,128>>]).</input> +<<"\x{400}"/utf8>> +ok</pre> </item> <tag><c>W</c></tag> <item> |