aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-06-19 14:18:29 +0200
committerDan Gudmundsson <[email protected]>2012-06-19 14:18:29 +0200
commit2f21ad26a9f3000d62660edde22874603aa2baaa (patch)
treebfe46ac99ea7aa59d51b7a4f3bc36657ddaed6d2 /lib/observer
parent91e67488391eee5f330da55339d46673848b9777 (diff)
downloadotp-2f21ad26a9f3000d62660edde22874603aa2baaa.tar.gz
otp-2f21ad26a9f3000d62660edde22874603aa2baaa.tar.bz2
otp-2f21ad26a9f3000d62660edde22874603aa2baaa.zip
Format latin binary strings in table viewer
Diffstat (limited to 'lib/observer')
-rw-r--r--lib/observer/src/observer_tv_table.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl
index f18d346f83..8fdcbf331c 100644
--- a/lib/observer/src/observer_tv_table.erl
+++ b/lib/observer/src/observer_tv_table.erl
@@ -24,6 +24,8 @@
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
handle_event/2, handle_sync_event/3, handle_cast/2]).
+-export([format/1]).
+
-include("observer_defs.hrl").
-import(observer_lib, [to_str/1]).
@@ -748,6 +750,13 @@ format(List) when is_list(List) ->
format_list(List);
format(Bin) when is_binary(Bin), byte_size(Bin) > 100 ->
io_lib:format("<<#Bin:~w>>", [byte_size(Bin)]);
+format(Bin) when is_binary(Bin) ->
+ try
+ true = printable_list(unicode:characters_to_list(Bin)),
+ io_lib:format("<<\"~ts\">>", [Bin])
+ catch _:_ ->
+ io_lib:format("~w", [Bin])
+ end;
format(Float) when is_float(Float) ->
io_lib:format("~.3g", [Float]);
format(Term) ->