[erlang-questions] Validate UTF-8 binary

Bengt Kleberg bengt.kleberg@REDACTED
Thu Aug 30 10:21:42 CEST 2012


Greetings,

No code, just the comment that is_*() functions should return
true/false. Not {}. Drop is_ from the name and you are fine.


bengt

On Thu, 2012-08-30 at 10:11 +0200, Zabrane Mickael wrote:
> Hi guys,
> 
> I'm looking after a code which can tell if a binary() is UTF-8 valid or not:
> 
> is_utf8_valid(Bin) when is_binary(Bin) -> true;
> is_utf8_valid(Bin) when is_binary(Bin) -> {false, Reason}.
> 
> Something to share?
> 
> Regards,
> Zabrane
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list