<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I retract my retraction. Setting aside the unworkable Farsi2 variable, Farsi (expressed in bytes) really should work, but displays as \x{641}\x{627}\x{631}\x{633}\x{6CC}. Why?<div><br></div><div>-John</div><div><br><div><div>On Mar 10, 2014, at 12:34 AM, John Daily <<a href="mailto:jd@epep.us">jd@epep.us</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">And I think I’ve found the solution in an older thread. Still no support for unicode strings directly embedded in the source. Thanks, sorry for the noise.<div><br></div><div>-John</div><div><br><div><div>On Mar 10, 2014, at 12:24 AM, John Daily <<a href="mailto:jd@epep.us">jd@epep.us</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span style="font-size: 15px;">I ran into a problem with io:format() when invoked remotely, and with Scott Fritchie’s assistance I’ve narrowed it down (I think) to escript.</span><div style="font-size: 15px;"><br></div><div style="font-size: 15px;">Here’s my script:</div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;"><div><font face="Andale Mono">#!/usr/bin/env escript</font></div><div><font face="Andale Mono">%%</font></div><div><font face="Andale Mono">%%! -sname foo</font></div><div><font face="Andale Mono"><br></font></div><div><font face="Andale Mono">main([]) -></font></div><div><font face="Andale Mono">   Other = 'bar@localhost',</font></div><div><font face="Andale Mono">   Farsi = [1601,1575,1585,1587,1740],</font></div><div><font face="Andale Mono">   Farsi2 = "فارسی",</font></div><div><font face="Andale Mono">   spawn(Other, fun() -> io:format("Bytes: ~ts~n", [Farsi]) end),</font></div><div><font face="Andale Mono">   spawn(Other, fun() -> io:format("Bytes: ~w~n", [Farsi]) end),</font></div><div><font face="Andale Mono">   spawn(Other, fun() -> io:format("Paste: ~ts~n", [Farsi2]) end),</font></div><div><font face="Andale Mono">   spawn(Other, fun() -> io:format("Paste: ~w~n", [Farsi2]) end),</font></div><div><font face="Andale Mono">   timer:sleep(1000).</font></div></div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;">When attempting this directly from a different node’s console (spawned to run on ‘bar’), everything displays as expected:</div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;"><div><font face="Andale Mono">Bytes: فارسی</font></div><div><font face="Andale Mono">Bytes: [1601,1575,1585,1587,1740]</font></div><div><font face="Andale Mono">Paste: فارسی</font></div><div><font face="Andale Mono">Paste: [1601,1575,1585,1587,1740]</font></div></div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;">When invoked via the above escript, I consistently get the wrong output:</div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;"><div><font face="Andale Mono">Bytes: \x{641}\x{627}\x{631}\x{633}\x{6CC}</font></div><div><font face="Andale Mono">Bytes: [1601,1575,1585,1587,1740]</font></div><div><font face="Andale Mono">Paste: فارسی</font></div><div><font face="Andale Mono">Paste: [217,129,216,167,216,177,216,179,219,140]</font></div></div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;">This is repeatable on R15B01 and R16B03-1, both under OS X Mavericks installed via kerl. My LANG environment variable is set to en_US.UTF-8, and all other UTF-8 behavior seems correct.</div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;">Just spun up an older Amazon Linux AMI instance running R15B01. Same behavior.</div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;">My unicode experience consists of years of banging my head against various toolchain problems with only a marginal clue as to what’s supposed to happen, so my ability to troubleshoot this further is limited.</div><div style="font-size: 15px;"><br></div><div style="font-size: 15px;">-John</div><div><br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></body></html>