title: Erlang - convert binary readable UTF
body: <p>I want to translate to web by YAWS info from mnesia database.
  Now i have code:</p>
  
  <pre><code>-define(RECORD_TYPE,      albums).
  -define(RECORD_KEY_FIELD, album_id).
  
  -record(?RECORD_TYPE,
          {?RECORD_KEY_FIELD, artist_id, album, albumpath, image}).
  
  convert_to_json(Lines) -&gt;
      Data = [{obj,
               [{id,     Line#?RECORD_TYPE.album_id},
                {aid,    Line#?RECORD_TYPE.artist_id},
                {path,   Line#?RECORD_TYPE.albumpath},
                {image,  Line#?RECORD_TYPE.image},
                {album,  Line#?RECORD_TYPE.album}]}
              || Line &lt;- Lines],
      JsonData = {obj, [{data, Data}]},
      rfc4627:encode(JsonData).
  
  handle('GET', _Arg) -&gt;
      io:format("~n ~p:~p GET Request ~n", [?MODULE, ?LINE]),
      Records = do(qlc:q([X || X &lt;- mnesia:table(?RECORD_TYPE)])),
      Json = convert_to_json(Records),
      io:format("~n ~p:~p GET Request Response ~p ~n", [?MODULE, ?LINE, Json]),
      {html, Json}.
  
  do(Q)-&gt;
      F = fun() -&gt;
                  qlc:e(Q)
          end,
      {atomic, Value} = mnesia:transaction(F),
      Value.
  </code></pre>
  
  <p>and test.yaws file:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;erl&gt;
  out(Arg) -&gt;
      Method = method(Arg) ,
      io:format("~p:~p ~p Request ~n", [?MODULE, ?LINE, Method]),
      my_json:handle(Method, Arg).
  
  method(Arg) -&gt;
    Rec = Arg#arg.req,
    Rec#http_request.method.
  &lt;/erl&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But i get binary info in YAWS output:</p>
  
  <pre><code>{"data":[{"id":8,"aid":3,"path":[[47,114,111,111,116,47,101,114,108,97,110,103,47,116,101,115,116,108,105,115,116,47,65,114,116,105,115,116,32,78,117,109,98,101,114,51,47,65,108,98,117,109,32,78,117,109,98,101,114,32,50]],"image":[[102,114,111,110,116,46,106,112,103]],"album":[65,108,98,117,109,32,78,117,109,98,101,114,32,50]},{"id":2,"aid":1,"path":[[47,114,111,111,116,47,101,114,108,97,110,103,47,116,101,115,116,108,105,115,116,47,65,114,116,105,115,116,32,78,117,109,98,101,114,49,47,65,108,98,117,109,32,78,117,109,98,101,114,32,50]],"image":[[99,111,118,101,114,46,112,110,103]],"album":[65,108,98,117,109,32,78,117,109,98,101,114,32,50]},{"id":14,"aid":5,"path":[[47,114,111,111,116,47,101,114,108,97,110,103,47,116,101,115,116,108,105,115,116,47,65,114,116,105,115,116,32,78,117,109,98,101,114,53,47,65,108,98,117,109,32,78,117,109,98,101,114,32,50]],"image":[],"album":[65,108,98,117,109,32,78,117,109,98,101,114,32,50]},{"id":12,"aid":4,"path": ..............
  </code></pre>
  
  <p>How i can convert this to strings?</p>
  
  <p>P.S. sorry for my english and thanks for any help.</p>