aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-02-15 10:35:54 +0100
committerGitHub <[email protected]>2017-02-15 10:35:54 +0100
commit4c2f4dd8e6682fe1557852c45961897d41f7a9c1 (patch)
treeb901d16b2fb618fc5886d96355b5d894ecc7a9d9 /lib/stdlib/src
parent0eb04da53fea8d56592f73dccacd1aa62fe672df (diff)
parentdb442323e9e86528edeb7226d55404e290b088b3 (diff)
downloadotp-4c2f4dd8e6682fe1557852c45961897d41f7a9c1.tar.gz
otp-4c2f4dd8e6682fe1557852c45961897d41f7a9c1.tar.bz2
otp-4c2f4dd8e6682fe1557852c45961897d41f7a9c1.zip
Merge pull request #1321 from bjorng/bjorn/stdlib/tilde-s-for-atoms
Make "~s" fail for Unicode atoms
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/io_lib_format.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/stdlib/src/io_lib_format.erl b/lib/stdlib/src/io_lib_format.erl
index c7b75961cb..3113767614 100644
--- a/lib/stdlib/src/io_lib_format.erl
+++ b/lib/stdlib/src/io_lib_format.erl
@@ -265,7 +265,10 @@ control($W, [A,Depth], F, Adj, P, Pad, _Enc, _Str, _I) when is_integer(Depth) ->
term(io_lib:write(A, Depth), F, Adj, P, Pad);
control($P, [A,Depth], F, Adj, P, Pad, Enc, Str, I) when is_integer(Depth) ->
print(A, Depth, F, Adj, P, Pad, Enc, Str, I);
-control($s, [A], F, Adj, P, Pad, _Enc, _Str, _I) when is_atom(A) ->
+control($s, [A], F, Adj, P, Pad, latin1, _Str, _I) when is_atom(A) ->
+ L = iolist_to_chars(atom_to_list(A)),
+ string(L, F, Adj, P, Pad);
+control($s, [A], F, Adj, P, Pad, unicode, _Str, _I) when is_atom(A) ->
string(atom_to_list(A), F, Adj, P, Pad);
control($s, [L0], F, Adj, P, Pad, latin1, _Str, _I) ->
L = iolist_to_chars(L0),