@nikitonsky Just had a look, and it just calls erlang.
Erlang implementation is here:
https://github.com/erlang/otp/blob/0164d3db05739fc1fad67ac1f5bf3e2aea15cd45/lib/stdlib/src/string.erl#L147
Erlang has a script which generates the unicode util code from the unicode spec. Macros would have been nice for that. :)
https://github.com/erlang/otp/blob/master/lib/stdlib/uc_spec/gen_unicode_mod.escript