[erlang-questions] replace bug or error in the documentation

Guilherme Andrade g@REDACTED
Thu Apr 19 02:05:37 CEST 2018


On 18 April 2018 at 22:57, John Doe <donpedrothird@REDACTED> wrote:

> > S = <<"fml.ölm vcrd rd hb kh ouniun">>.
>


It seems to work properly when one declares the proper encoding of the
string literal, e.g.:

   <<"fml.ölm vcrd rd hb kh ouniun"/utf8>>

In any case, the error is reproducible with the non-compiled regex if you
pass 'unicode' option when calling :replace.

   re:replace(S, <<>>, <<>>,  [unicode, global, {return, binary}])

That is: the non-compiled call wasn't interpreting the input as UTF8. Which
is why it worked.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180419/12bf53f7/attachment.htm>


More information about the erlang-questions mailing list