From 1ea34229d912ce387e6c3b98ac44e7c25425b70a Mon Sep 17 00:00:00 2001 From: Gordon Guthrie Date: Mon, 12 Dec 2016 13:08:48 +0000 Subject: [PATCH] Make the replay out put handle unicode input --- tests/riak_shell_test_util.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/riak_shell_test_util.erl b/tests/riak_shell_test_util.erl index e4b955857..d63d05e04 100644 --- a/tests/riak_shell_test_util.erl +++ b/tests/riak_shell_test_util.erl @@ -107,7 +107,9 @@ run_commands([{run, Cmd} | T], State, ShouldIncrement) -> run_commands(T, NewState, ShouldIncrement). cleanup_output(In) -> - re:replace(lists:flatten(In), "[\r\n]", "", [global,{return,list}]). + InBin = unicode:characters_to_binary(lists:flatten(In)), + {ok, Regex} = re:compile("[\r\n]", [unicode]), + re:replace(InBin, Regex, "", [global,{return,list}]). run_cmd(Command, State, ShouldIncrement) -> %% the riak-shell works by spawning a process that has captured