Current section

Files

Jump to
string_width src string_width_ffi.erl
Raw

src/string_width_ffi.erl

-module(string_width_ffi).
-export([
fold_codepoints/3,
utf_codepoint_to_string/1
]).
fold_codepoints(Binary, State, Fun) ->
case Binary of
<<Cp/utf8, Rest/binary>> -> fold_codepoints(Rest, Fun(State, Cp), Fun);
_ -> State
end.
utf_codepoint_to_string(Cp) ->
<<Cp/utf8>>.