diff options
author | Björn Gustavsson <[email protected]> | 2017-02-15 10:35:54 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-02-15 10:35:54 +0100 |
commit | 4c2f4dd8e6682fe1557852c45961897d41f7a9c1 (patch) | |
tree | b901d16b2fb618fc5886d96355b5d894ecc7a9d9 /lib/stdlib/src | |
parent | 0eb04da53fea8d56592f73dccacd1aa62fe672df (diff) | |
parent | db442323e9e86528edeb7226d55404e290b088b3 (diff) | |
download | otp-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.erl | 5 |
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), |