From 1b4280cd2e8dcab457562bbaacc4e1d16d372185 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 13 Feb 2013 17:24:05 +0100 Subject: Document +pc flag and io:printable_range/0 --- lib/stdlib/doc/src/io.xml | 12 ++++++++++++ lib/stdlib/doc/src/io_lib.xml | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'lib/stdlib/doc/src') diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml index 63f814ad2e..90f24c4cbc 100644 --- a/lib/stdlib/doc/src/io.xml +++ b/lib/stdlib/doc/src/io.xml @@ -210,6 +210,18 @@

This example is, as can be seen, run in an environment where the terminal supports Unicode input and output.

+ + + Get user requested printable character range + +

Return the user requested range of printable Unicode characters.

+

The user can request a range of characters that are to be considered printable in heuristic detection of strings by the shell and by the formatting functions. This is done by supplying +pc <range> when starting Erlang.

+

Currently the only valid values for <range> are latin1 and unicode. latin1 means that only code points below 256 (with the exception of control characters etc) will be considered printable. unicode means that all printable characters in all unicode character ranges are considered printable by the io functions.

+

By default, Erlang is started so that only the latin1 range of characters will indicate that a list of integers is a string.

+

The simplest way to utilize the setting is to call io_lib:printable_list/1, which will use the return value of this function to decide if a list is a string of printable characters or not.

+

In the future, this function may return more values and ranges. It is recommended to use the io_lib:printable_list/1 function to avoid compatibility problems.

+
+
diff --git a/lib/stdlib/doc/src/io_lib.xml b/lib/stdlib/doc/src/io_lib.xml index 001d34a7c2..3dac259477 100644 --- a/lib/stdlib/doc/src/io_lib.xml +++ b/lib/stdlib/doc/src/io_lib.xml @@ -301,7 +301,11 @@ Test for a list of printable characters

Returns true if Term is a flat list of - printable Unicode characters, otherwise it returns false.

+ printable characters, otherwise it returns false.

+

What is a printable character in this case is determined by the + +pc start up flag to the Erlang VM. See + io:printable_range/0 + and erl(1).

@@ -312,6 +316,14 @@ printable ISO-latin-1 characters, otherwise it returns false.

+ + + Test for a list of printable Unicode characters + +

Returns true if Term is a flat list of + printable Unicode characters, otherwise it returns false.

+
+
-- cgit v1.2.3