<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>This is correct UTF8 binary.</div><div><br></div><div><div>unicode:characters_to_list(B). </div><div>"Föö"</div></div><div><br></div><div><<_:8, A1/utf8, A2/utf8>> = <<"Föö">>.</div><div>A1 = 246</div><div><br></div><div>- Dmitry</div><div><br></div><div><div><div>On Dec 4, 2013, at 3:15 PM, Carl-Johan Kjellander <<a href="mailto:carljohan.kjellander@gmail.com">carljohan.kjellander@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div style="" class="" id="markdown-here-wrapper-122555"><p style="margin:1.2em 0px!important">I’m having utf-8 double encoding issues when sending binaries between Java and Erlang.</p>
<pre style="font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);display:block;padding:0.5em;color:rgb(51,51,51);background:none repeat scroll 0% 0% rgb(248,248,255)" class=""> java.lang.String foo = <span style="color:rgb(51,51,51);font-weight:bold" class="">new</span> java.lang.String(<span style="color:rgb(221,17,68)" class="">"Föö"</span>);
record[<span style="color:rgb(0,153,153)" class="">2</span>] = <span style="color:rgb(51,51,51);font-weight:bold" class="">new</span> OtpErlangBinary(foo.getBytes());</code></pre><p style="margin:1.2em 0px!important">But of course that comes back as <<"Föö">> to my erlang node.</p><p style="margin:1.2em 0px!important">Anyone have an idea why? Or how to fix? I'm compiling the java code with -encoding UTF-8 and using Erlang R15B (erts-5.9).</p><p style="margin:1.2em 0px!important">/cjk</p><p style="margin:1.2em 0px!important"><br></p></div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br></div></body></html>