How to execute two utf8 lines in erlang?
1 answer
utf8- it's just coding. It is binary like any other binary:
1> A = <<"سعید"/utf8>>,
1> B = <<"حیدری"/utf8>>,
1> C = <<A/bytes, B/bytes>>.
<<216,179,216,185,219,140,216,175,216,173,219,140,216,175,
216,177,219,140>>
2> io:put_chars([C, $\n]).
سعیدحیدری
ok
PS: The result is shown in reverse order due to web browser behavior. It appears in the correct order on the console.
+7