diff options
author | Hans Bolinder <[email protected]> | 2017-05-24 17:07:25 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-06-09 09:11:14 +0200 |
commit | fb466f01a54c9936eee94745a26acd415cb15ae3 (patch) | |
tree | 01c5017f7fbfb3105fa98358ea555300951b3005 /lib/stdlib/src/io_lib_pretty.erl | |
parent | a0e5e5ba85e91babeed52329fb6ed4ac10817bd1 (diff) | |
download | otp-fb466f01a54c9936eee94745a26acd415cb15ae3.tar.gz otp-fb466f01a54c9936eee94745a26acd415cb15ae3.tar.bz2 otp-fb466f01a54c9936eee94745a26acd415cb15ae3.zip |
stdlib: Handle Unicode atoms better in io_lib_format
The field width calculation did not handle graphem clusters well.
Diffstat (limited to 'lib/stdlib/src/io_lib_pretty.erl')
-rw-r--r-- | lib/stdlib/src/io_lib_pretty.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/stdlib/src/io_lib_pretty.erl b/lib/stdlib/src/io_lib_pretty.erl index ff368d02da..505613b80e 100644 --- a/lib/stdlib/src/io_lib_pretty.erl +++ b/lib/stdlib/src/io_lib_pretty.erl @@ -473,7 +473,7 @@ print_length(<<_/bitstring>>=Bin, D, _RF, Enc, Str) -> print_length(Term, _D, _RF, _Enc, _Str) -> S = io_lib:write(Term), %% S can contain unicode, so iolist_size(S) cannot be used here - {S, lists:flatlength(S)}. + {S, string:length(S)}. print_length_map(_Map, 1, _RF, _Enc, _Str) -> {"#{...}", 6}; |