From 75238dc582f5dcf69dfc00b7719dca7d50ca9a68 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 13 Feb 2013 14:32:47 +0100 Subject: 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. --- lib/stdlib/src/io.erl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/stdlib/src/io.erl') 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(). -- cgit v1.2.3