aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/io.erl
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-02-13 14:32:47 +0100
committerPatrik Nyblom <[email protected]>2013-02-18 11:49:11 +0100
commit75238dc582f5dcf69dfc00b7719dca7d50ca9a68 (patch)
tree88e259a75d0bc80605e067d3b8fe77927b4edad8 /lib/stdlib/src/io.erl
parentbfe9aeb47b494ec4243549340f9abf2a246e35a0 (diff)
downloadotp-75238dc582f5dcf69dfc00b7719dca7d50ca9a68.tar.gz
otp-75238dc582f5dcf69dfc00b7719dca7d50ca9a68.tar.bz2
otp-75238dc582f5dcf69dfc00b7719dca7d50ca9a68.zip
Add usage of and spec for io:printable_range/0
This makes both io:format("~tp", ...) and the shell honor the +pc setting and also reverts the shell to the old behaviour of only interpreting latin1 strings as "strings" by default. +pc unicode turns on the R16A behaviour. Doing io:format("~tp~n", [[1024,1025]]). will show you the difference when starting with +pc unicode.
Diffstat (limited to 'lib/stdlib/src/io.erl')
-rw-r--r--lib/stdlib/src/io.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/stdlib/src/io.erl b/lib/stdlib/src/io.erl
index 3dddb0d6e7..c92e9e3ade 100644
--- a/lib/stdlib/src/io.erl
+++ b/lib/stdlib/src/io.erl
@@ -32,6 +32,8 @@
parse_erl_exprs/4,parse_erl_form/1,parse_erl_form/2,
parse_erl_form/3,parse_erl_form/4]).
-export([request/1,request/2,requests/1,requests/2]).
+%% Implemented in native code
+-export([printable_range/0]).
-export_type([device/0, format/0, server_no_data/0]).
@@ -66,6 +68,11 @@ o_request(Io, Request, Func) ->
Other
end.
+%% Request what the user considers printable characters
+-spec printable_range() -> 'unicode' | 'latin1'.
+printable_range() ->
+ erlang:nif_error(undefined).
+
%% Put chars takes mixed *unicode* list from R13 onwards.
-spec put_chars(CharData) -> 'ok' when
CharData :: unicode:chardata().