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

Method gen-strings exceeds limit for UTF-8 #12

Open
lzap opened this issue Oct 31, 2019 · 0 comments
Open

Method gen-strings exceeds limit for UTF-8 #12

lzap opened this issue Oct 31, 2019 · 0 comments

Comments

@lzap
Copy link

lzap commented Oct 31, 2019

Hello,

generation of UTF-8 strings (CJK, UTF8) does not respect byte limit (255 in my example) and can return string longer than given bytes:

RFauxFactory.gen_strings(1..255).values
RFauxFactory.gen_utf8(1..255)
RFauxFactory.gen_cjk(1..255)

Expected behaviour is obviously to respect the limit. In Foreman codebase, I've temporarily used truncate_bytes method from Rails 6+ to fix that.

RFauxFactory.gen_strings(1..255).values.map {|x| x.truncate_bytes(255, omission: '')},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant