%%%------------------------------------------------------------------- %%% @author ysx %%% @copyright (C) 2015, %%% @doc %%% %%% @end %%% Created : 06. Aug 2015 6:21 PM %%%------------------------------------------------------------------- -module(string_format). -author("ysx"). %% ======================================================= %% API %% ======================================================= -export([utf8/2]). %% Format = io:format() %% Data = [term()] utf8(Format, Data) -> A = io_lib:format(Format, Data), B = lists:flatten(A), unicode:characters_to_binary(B, utf8). %% ======================================================= %% Internal %% =======================================================