<br><br><div class="gmail_quote">2011/9/1 Slav Pankratov <span dir="ltr"><<a href="mailto:gnoblin@gmail.com">gnoblin@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<span style="font-family:helvetica, arial, freesans, clean, sans-serif;font-size:11px;line-height:14px;background-color:rgb(255, 255, 255)"><pre style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;font-family:'Bitstream Vera Sans Mono', 'Courier New', monospace;font-size:12px;line-height:1.4">
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:1em"><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">Hello!</span></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:1em"><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><br>
</span></div></pre></span><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="font-size:12px;line-height:16px;white-space:pre-wrap"> I'm using misultin to receive http calls, and they sometimes contain Russian symbols (unicode).<br>
</span></font><span style="background-color:rgb(255, 255, 255)"><pre style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:1em">
<span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="color:rgb(153, 153, 136);line-height:1.4"><i>
</i></span></font></span><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="line-height:16px">% handle a GET on /users/{username}<br>
</span></font></span><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="line-height:16px">handle('GET', ["users", UserName], Req) -><br>
</span></font></span><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="line-height:16px"> io:format("~s~n", [UserName]),<br>
</span></font></span><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="line-height:16px"> Req:ok([{"Content-Type", "text/plain"}], "This is ~s's page.", [UserName]);</span></font></span></blockquote>
</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:1em"><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="line-height:16px"><br>
</span></font></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:1em"><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"><font face="'Bitstream Vera Sans Mono', 'Courier New', monospace"><span style="line-height:16px">In both terminal and browser I see incorrect output - what can be done about it?
big thanks,
Slav</span></font></span></div></pre></span></blockquote><div><br>hi slav,<br><br>this is not particularly related to misultin. when using uri you need to ensure that these are properly encoded for HTTP. You also need to ensure that the browser is rendering html encoded in UTF-8 so you should have in your code:<br>
<br>% handle a GET on /users/{username}<br>handle('GET', ["users", UserName], Req) -><br> Req:ok([{"Content-Type", "text/html; charset=UTF-8"}], "This is ~s's page.", [UserName]);<br>
<br>then, you may serve the page:<br><br><a href="http://localhost:8080/users/%26%231055%3B%26%231088%3B%26%231080%3B%26%231074%3B%26%231077%3B%26%231090%3B">http://localhost:8080/users/%26%231055%3B%26%231088%3B%26%231080%3B%26%231074%3B%26%231077%3B%26%231090%3B</a><br>
<br>that will print;<br><br>This is Привет's page.<br><br>you probably also could read into IRI: <a href="http://tools.ietf.org/html/rfc3987">http://tools.ietf.org/html/rfc3987</a><br></div></div><br>my 2c.<br><br>r.<br>