From aff273316da2822d589faf202598f9f282bf6f32 Mon Sep 17 00:00:00 2001 From: Byaruhanga Franklin Date: Tue, 13 Oct 2015 02:27:45 +0300 Subject: Fix for issue #859 - unicode rendering of deps tree based on PR #865 Fix for issue #859 - unicode rendering of deps tree based on PR #865 modified PR #865 to the /utf8 flag indicates this is supposed to be a UTF8 string. --- src/rebar_prv_deps_tree.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rebar_prv_deps_tree.erl b/src/rebar_prv_deps_tree.erl index 04c4837..07c25ea 100644 --- a/src/rebar_prv_deps_tree.erl +++ b/src/rebar_prv_deps_tree.erl @@ -66,13 +66,13 @@ print_children(_, [], _, _) -> print_children(Prefix, [{Name, Vsn, Source} | Rest], Dict, Verbose) -> Prefix1 = case Rest of [] -> - io:format("~ts└─ ", [Prefix]), + io:format("~ts~ts", [Prefix, <<"└─ "/utf8>>]), [Prefix, " "]; _ -> - io:format("~ts├─ ", [Prefix]), + io:format("~ts~ts", [Prefix, <<"├─ "/utf8>>]), [Prefix, "│ "] end, - io:format("~ts─~ts (~ts)~n", [Name, Vsn, type(Source, Verbose)]), + io:format("~ts~ts~ts (~ts)~n", [Name, <<"─"/utf8>>, Vsn, type(Source, Verbose)]), case dict:find(Name, Dict) of {ok, Children} -> print_children(Prefix1, lists:keysort(1, Children), Dict, Verbose), -- cgit v1.1 From d63d285e8b924803d691ce1da5379cda53075fa2 Mon Sep 17 00:00:00 2001 From: Byaruhanga Franklin Date: Tue, 13 Oct 2015 04:59:55 +0300 Subject: removing the /utf8 flag and using the the exact utf-8 value in bytes removing the /utf8 flag and using the the exact utf-8 value in bytes to make it compatible with compilers <17 --- src/rebar_prv_deps_tree.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rebar_prv_deps_tree.erl b/src/rebar_prv_deps_tree.erl index 07c25ea..b8b5094 100644 --- a/src/rebar_prv_deps_tree.erl +++ b/src/rebar_prv_deps_tree.erl @@ -66,13 +66,13 @@ print_children(_, [], _, _) -> print_children(Prefix, [{Name, Vsn, Source} | Rest], Dict, Verbose) -> Prefix1 = case Rest of [] -> - io:format("~ts~ts", [Prefix, <<"└─ "/utf8>>]), + io:format("~ts~ts", [Prefix, <<226,148,148,226,148,128,32>>]), [Prefix, " "]; _ -> - io:format("~ts~ts", [Prefix, <<"├─ "/utf8>>]), + io:format("~ts~ts", [Prefix, <<226,148,156,226,148,128,32>>]), [Prefix, "│ "] end, - io:format("~ts~ts~ts (~ts)~n", [Name, <<"─"/utf8>>, Vsn, type(Source, Verbose)]), + io:format("~ts~ts~ts (~ts)~n", [Name, <<226,148,128>>, Vsn, type(Source, Verbose)]), case dict:find(Name, Dict) of {ok, Children} -> print_children(Prefix1, lists:keysort(1, Children), Dict, Verbose), -- cgit v1.1 From 2e2a37baf67b5bfa89d34f409ce658039508caad Mon Sep 17 00:00:00 2001 From: Byaruhanga Franklin Date: Wed, 14 Oct 2015 04:13:59 +0300 Subject: Added comments to explain the utf8 symbols Binary --- src/rebar_prv_deps_tree.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rebar_prv_deps_tree.erl b/src/rebar_prv_deps_tree.erl index b8b5094..cefa60a 100644 --- a/src/rebar_prv_deps_tree.erl +++ b/src/rebar_prv_deps_tree.erl @@ -66,13 +66,13 @@ print_children(_, [], _, _) -> print_children(Prefix, [{Name, Vsn, Source} | Rest], Dict, Verbose) -> Prefix1 = case Rest of [] -> - io:format("~ts~ts", [Prefix, <<226,148,148,226,148,128,32>>]), + io:format("~ts~ts", [Prefix, <<226,148,148,226,148,128,32>>]), %Binary for └─ utf8% [Prefix, " "]; _ -> - io:format("~ts~ts", [Prefix, <<226,148,156,226,148,128,32>>]), + io:format("~ts~ts", [Prefix, <<226,148,156,226,148,128,32>>]), %Binary for ├─ utf8% [Prefix, "│ "] end, - io:format("~ts~ts~ts (~ts)~n", [Name, <<226,148,128>>, Vsn, type(Source, Verbose)]), + io:format("~ts~ts~ts (~ts)~n", [Name, <<226,148,128>>, Vsn, type(Source, Verbose)]), %Binary for ─ utf8% case dict:find(Name, Dict) of {ok, Children} -> print_children(Prefix1, lists:keysort(1, Children), Dict, Verbose), -- cgit v1.1