[erlang-questions] Validate UTF-8 binary

Michael Uvarov <>
Thu Aug 30 10:21:14 CEST 2012


is_unicode_valid(Str) ->
    Bin = unicode:characters_to_binary(Str),
    if is_binary(Bin) -> true;   true -> {false, Bin}  end.

Str can be binary or characters.

--
Best regards,
Uvarov Michael



More information about the erlang-questions mailing list