Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for generating unicode strings #118

Open
emil-e opened this issue Mar 10, 2016 · 4 comments
Open

Add support for generating unicode strings #118

emil-e opened this issue Mar 10, 2016 · 4 comments

Comments

@emil-e
Copy link
Owner

emil-e commented Mar 10, 2016

No description provided.

@P-Andersson
Copy link

I might implement this myself as I ran into the need for it just recently. I'm guessing generators for different encodings would be desired (UTF8, UTF16 and UTF32?) and possibly the option of specifying desired ranges.

@emil-e
Copy link
Owner Author

emil-e commented Mar 11, 2016

UTF8 is obviously the most important since that is likely what goes into std::string. Specifying ranges would also be nice but for arbitrary the range should be based on size.

If you want to take a stab at this, you can look at Text.h for inspiration since the naive way of using gen::container likely be wasteful of random bits thus giving bad performance. A PR with tests and docs will be met with open arms :)

@P-Andersson
Copy link

I've been thinking how to best go about shrinking UTF8 characters, was thinking to remove one byte from it at each iteration and when only one byte is left to the regular character shrinking...

@emil-e
Copy link
Owner Author

emil-e commented Mar 13, 2016

If you generate code points that you map to the respective encoding, you can just shrink those and the bytes in the UTF8 characters will become fewer automatically. UTF32 will probably serve as a good base given that it's essentially unencoded code points and the other ones can simply be mappings of that one.

Just like with the regular string generator, you might want to shrink characters down to some simple ones first, like abc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants