You can clone with
No one assigned
For a project I am working on I created a PropEr utf8 generator:
I guess it might be useful for others if they need UTF8 binaries for some reason. Would you consider including it to PropEr? If yes, I can make a proper pull request. If not, I will not bother.
Yes, this will be useful, I think. There is a question mark whether this should be named "utf8_binary" instead of "utf8_string", but perhaps this is a detail.
If you are making a pull request, we would appreciate if it comes with proper(TM) documentation and tests for the new functionality.
Thanks in advance for your contribution.
OK, this is a proposal:utf8_codepoint() returns a binary 1-4 bytes length; a valid codepoint.utf8_binary() returns a utf8 binary of undefined length (like list())
We probably want utf8_binary(Len :: int()), which returns a utf8 binary of length Len.
utf8_binary(Len :: int())
There are 2 possible meanings of Len: number of codepoints (as it is now), or number of bytes (which would make more sense IMO). I will make it the number of bytes.
Yes, it does. Also, bytes is probably more useful than codepoints. But make sure that utf8_binary(Len) behaves properly in its shrinking.
I made the custom generator, however, it has 1 problem: it doesn't shrink properly. I did all the necessary wrappers I could think of, but still could not find the root cause of it failing.
See it here: https://github.com/Motiejus/proper/compare/utf8
In order to reproduce the issue just run the tests. Shrinking tests will fail.