<div dir="ltr">Hello OTP Team,<div><br></div><div>I am using Erlang 17.0 and it seems the standard_error device is not being set to unicode. On a Mac OS X:</div><div><br></div><div>1> io:format("~p~n", ["josé"]).</div>
<div>"josé"</div><div>ok</div><div><div>2> io:format(standard_error, "~p~n", ["josé"]).</div><div>"jos�"</div><div>ok</div><div><div><br></div><div>If we inspect the standard_error process, we can see in the process dictionary that unicode is set to false:</div>
<div><br></div><div>3> process_info(whereis(standard_error), dictionary).<br></div><div>{dictionary,[{unicode,false}]}<br></div><div><br></div><div>Once I explicitly enable unicode, it works:</div><div><br></div><div>
<div>
4> io:setopts(standard_error, [{unicode, true}]).</div><div>ok</div></div><div><div>5> io:format(standard_error, "~p~n", ["josé"]).</div><div>"josé"</div><div>ok</div><div></div></div>
<div>
<br></div><div>Thank you!</div><div><br></div><div>PS: I found it interesting that the standard_error process does not accept the same options as the standard_io one:</div><div><br></div><div><div>6> io:setopts(standard_error, [{encoding, utf8}]).</div>
<div>{error,enotsup}</div><div>7> io:setopts(standard_error, [{unicode, true}]).</div><div>ok</div><div>8> io:setopts(standard_io, [{unicode, true}]).</div><div>{error,enotsup}</div><div>9> io:setopts(standard_io, [{encoding, utf8}]).</div>
<div>ok</div></div><div><br></div><div>However this seems to be an "old" behaviour (it exists at least in R16 too).</div><div><br></div><div><span style="font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div>
<div><span style="font-family:verdana,sans-serif;font-size:x-small">Skype: jv.ptec</span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Lead Developer</span></div></span></div></span></div>
</div>
</div></div>