<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
This is probably not related to SSH.<br>
As was found out earlier on this list, the encoding behaviour
(confusingly) depends on how Erlang was started:<br>
<blockquote>$ erl -eval 'ok = io:setopts([{encoding, unicode}]),
io:format("~p~n", [io:getopts()]), init:stop().'<br>
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:8]
[async-threads:0] [hipe] [kernel-poll:false]<br>
<br>
Eshell V5.8.4 (abort with ^G)<br>
1> [{expand_fun,#Fun<group.0.120017273>},<br>
{echo,true},<br>
{binary,false},<br>
{encoding,latin1}]<br>
$ erl -eval 'ok = io:setopts([{encoding, unicode}]),
io:format("~p~n", [io:getopts()]), init:stop().' -noinput<br>
[{binary,false},{encoding,unicode}]<br>
$ erl -eval 'ok = io:setopts([{encoding, unicode}]),
io:format("~p~n", [io:getopts()]), init:stop().' -noshell<br>
[{binary,false},{encoding,unicode}]<br>
</blockquote>
This has do do with the fact that in one case, the 'group' module
handles I/O, while in the other case it's the 'user' module.<br>
(I don't know enough to say anything intelligent about why this is,
why two modules with overlapping functionality but different
encoding behaviour exist, or what their purposes are besides
handling I/O.)<br>
<br>
On 31-01-2012 14:00, Fyodor Ustinov wrote:
<blockquote cite="mid:4F27E5D6.70500@ufm.su" type="cite">
<pre wrap="">Hi!
Unable to set encoding to unicode in ssh daemon session.
ok = io:setopts([{expand_fun, fun expand_prompt/1}, {encoding, unicode}]),
io:format("~p~n", [io:getopts()])
say:
[{expand_fun,#Fun<group.0.33302583>},
{echo,true},
{binary,false},
{encoding,latin1}]
WBR,
Fyodor.
_______________________________________________
erlang-bugs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-bugs">http://erlang.org/mailman/listinfo/erlang-bugs</a>
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<div style="color: black; text-align: center;"> <span>Mobile: +
45 26 36 17 55</span> <span> </span> <span style="color:
black;">| Skype: eriksoesorensen</span> <span> </span> <span
style="color: black;">| Twitter: @eriksoe</span>
</div>
<div style="text-align: center; color: gray;"> <span>Trifork A/S
| Margrethepladsen 4 | DK-8000 Aarhus C | </span> <a
href="http://www.trifork.com/"><span style="text-decoration:
underline; color: gray;">www.trifork.com</span></a>
</div>
</div>
</body>
</html>