aboutsummaryrefslogtreecommitdiffstats
path: root/lib/et/src/et_wx_contents_viewer.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2017-09-07 16:16:01 +0200
committerSiri Hansen <[email protected]>2017-09-07 16:16:01 +0200
commitb569db7fd80de6f6f049797fa7676bdfbe55cc4f (patch)
treeff24ace33a45b2dc75f9d955a88bc92fdc2f2acc /lib/et/src/et_wx_contents_viewer.erl
parent8e3baffd206247d3023c3e00d4d0849c23f3fc58 (diff)
parent87fa9801618397087d6a7b521e370506c5bfff91 (diff)
downloadotp-b569db7fd80de6f6f049797fa7676bdfbe55cc4f.tar.gz
otp-b569db7fd80de6f6f049797fa7676bdfbe55cc4f.tar.bz2
otp-b569db7fd80de6f6f049797fa7676bdfbe55cc4f.zip
Merge branch 'siri/unicode-merge' into maint
* siri/unicode-merge: (28 commits) stdlib: use 'unicode' option for regexp in ets ct: use 'unicode' option for regexps syntax_tools: add 'unicode' option to re:run for matching paths kernel: update simple error logger to print Unicode strings stdlib: add Unicode translation modifier in error_logger_tty_h wx: add Unicode translation modifier to wx_object stdlib: add Unicode translation modifier in debug format funs sasl: set encoding of SASL report log stdlib: use Unicode translation modifier in error_logger_file_h observer: Improve handling of Unicode mnesia: Improve handling of Unicode stdlib : Improve handling of Unicode kernel: Improve handling of Unicode hipe: Improve handling of Unicode edoc: Improve handling of Unicode syntax_tools: Improve handling of Unicode dialyzer: Improve handling of Unicode et: Improve handling of Unicode xref: Improve handling of Unicode fprof: Modify handling of Unicode eprof: Improve handling of Unicode eunit: Improve handling of Unicode stdlib: Improve handling of Unicode in escript stdlib: Improve handling of Unicode in edlin_expand stdlib: Modify handling of Unicode in proc_lib sasl: Improve handling of Unicode edoc: Improve handling of Unicode debugger: Improve handling of Unicode OTP-14462 OTP-14464
Diffstat (limited to 'lib/et/src/et_wx_contents_viewer.erl')
-rw-r--r--lib/et/src/et_wx_contents_viewer.erl21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/et/src/et_wx_contents_viewer.erl b/lib/et/src/et_wx_contents_viewer.erl
index 247dd4c7ba..bca517317e 100644
--- a/lib/et/src/et_wx_contents_viewer.erl
+++ b/lib/et/src/et_wx_contents_viewer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -213,7 +213,7 @@ init([S]) when is_record(S, state) ->
%%----------------------------------------------------------------------
handle_call(Request, From, S) ->
- ok = error_logger:format("~p(~p): handle_call(~p, ~p, ~p)~n",
+ ok = error_logger:format("~p(~p): handle_call(~tp, ~tp, ~tp)~n",
[?MODULE, self(), Request, From, S]),
Reply = {error, {bad_request, Request}},
{reply, Reply, S}.
@@ -226,7 +226,7 @@ handle_call(Request, From, S) ->
%%----------------------------------------------------------------------
handle_cast(Msg, S) ->
- ok = error_logger:format("~p(~p): handle_cast(~p, ~p)~n",
+ ok = error_logger:format("~p(~p): handle_cast(~tp, ~tp)~n",
[?MODULE, self(), Msg, S]),
{noreply, S}.
@@ -272,10 +272,11 @@ handle_event(#wx{id = Id,
end,
FileName = lists:flatten(["et_contents_viewer_", now_to_string(TimeStamp), ".txt"]),
Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
- Msg = "Select a file to the events to",
+ Msg = "Select a file to save events to",
case select_file(S#state.frame, Msg, filename:absname(FileName), Style) of
{ok, FileName2} ->
- Bin = list_to_binary(event_to_string(Event, S#state.event_order)),
+ EventString = event_to_string(Event, S#state.event_order),
+ Bin = unicode:characters_to_binary(EventString),
ok = file:write_file(FileName2, Bin);
cancel ->
ok
@@ -381,7 +382,7 @@ handle_event(#wx{event = #wxSize{size = {W, H}}}, S) ->
S2 = S#state{width = W, height = H},
{noreply, S2};
handle_event(Wx = #wx{}, S) ->
- io:format("~p got an unexpected event: ~p\n", [self(), Wx]),
+ io:format("~p got an unexpected event: ~tp\n", [self(), Wx]),
{noreply, S}.
%%----------------------------------------------------------------------
@@ -405,7 +406,7 @@ handle_info({'EXIT', Pid, Reason}, S) ->
{noreply, S}
end;
handle_info(Info, S) ->
- ok = error_logger:format("~p(~p): handle_info(~p, ~p)~n",
+ ok = error_logger:format("~p(~p): handle_info(~tp, ~tp)~n",
[?MODULE, self(), Info, S]),
{noreply, S}.
@@ -606,8 +607,8 @@ do_config_editor(Editor, Event, _Colour, TsKey) ->
%%%----------------------------------------------------------------------
term_to_string(Term) ->
- case catch io_lib:format("~s", [Term]) of
- {'EXIT', _} -> io_lib:format("~p", [Term]);
+ case catch io_lib:format("~ts", [Term]) of
+ {'EXIT', _} -> io_lib:format("~tp", [Term]);
GoodString -> GoodString
end.
@@ -659,7 +660,7 @@ pad_string(Int, MinLen, Char, Dir) when is_integer(Int) ->
pad_string(Atom, MinLen, Char, Dir) when is_atom(Atom) ->
pad_string(atom_to_list(Atom), MinLen, Char, Dir);
pad_string(String, MinLen, Char, Dir) when is_integer(MinLen), MinLen >= 0 ->
- Len = length(String),
+ Len = string:length(String),
case {Len >= MinLen, Dir} of
{true, _} ->
String;