From 64a697339414f424073c5b021285fddb0ff2d9da Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 10 Feb 2010 15:47:09 +0000 Subject: OTP-8418 user.erl (used in oldshell) is updated to handle unicode in prompt strings (io:get_line/{1,2}). io_lib is also updated to format prompts with the 't' modifier (i.e. ~ts instead of ~s). --- lib/kernel/src/user.erl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/kernel/src') diff --git a/lib/kernel/src/user.erl b/lib/kernel/src/user.erl index edf650ec59..17dc5a56a2 100644 --- a/lib/kernel/src/user.erl +++ b/lib/kernel/src/user.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% -module(user). @@ -698,7 +698,11 @@ get_chars_more(State, M, F, Xa, Port, Q, Fmt) -> prompt(_Port, '') -> ok; prompt(Port, Prompt) -> - put_port(io_lib:format_prompt(Prompt), Port). + put_port(wrap_characters_to_binary(io_lib:format_prompt(Prompt),unicode, + case get(unicode) of + true -> unicode; + _ -> latin1 + end), Port). %% Convert error code to make it look as before err_func(io_lib, get_until, {_,F,_}) -> -- cgit v1.2.3