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

String#[]= can break UTF-8 length counting #3448

Closed
dabroz opened this issue Feb 10, 2017 · 0 comments
Closed

String#[]= can break UTF-8 length counting #3448

dabroz opened this issue Feb 10, 2017 · 0 comments

Comments

@dabroz
Copy link
Contributor

@dabroz dabroz commented Feb 10, 2017

At commit c802cd0

When mruby is compiled with MRB_UTF8_STRING, following code gives weird results:

a = ' ' * 34
a[-6..-1] = 'foobór'
a.length # is 35, should be 34
a.split('').length # is 34
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