[erlang-questions] Validate UTF-8 binary

Marc Worrell <>
Thu Aug 30 10:47:27 CEST 2012


Good pointer Michael.

The Zotonic routines are from the R12 days, now that we are dropping support for R13( and earlier) we can replace some code with the unicode module.

- Marc


On 30 aug. 2012, at 10:21, Michael Uvarov wrote:

> 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