Simplify character replacement on non-UTF-8 terminals and make a common function.
Simplify character replacement on non-UTF-8 terminals and make a common
function.

klaxalk/tmux,klaxalk/tmux,klaxalk/tmux,klaxalk/tmux,klaxalk/tmux