From fb466f01a54c9936eee94745a26acd415cb15ae3 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 24 May 2017 17:07:25 +0200 Subject: stdlib: Handle Unicode atoms better in io_lib_format The field width calculation did not handle graphem clusters well. --- lib/stdlib/src/io_lib_pretty.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/stdlib/src/io_lib_pretty.erl') 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}; -- cgit v1.2.3