-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
substring of index/rindex doesn't work for utf8 inputs #1624
Comments
You're right and I've updated the FAQ so that it uses
Thank you! |
match works, but it's really confusing that index and slice use different string model (bytes vs strings) |
I believe this behavior is worth changing its default. How much is byte index important in jq? Defining index of type string by |
Same issue: #1430. |
@itchyny - Changing the semantics of Rather than tilting at that particular windmill, I would suggest adding a new C-coded built-in function with the desired semantics, not least because the existing implementation of Although there is something to be said for a function with a narrow domain (e.g. |
Okay, thanks for detail explanation. |
Previsouly byte index was used. Fixes jqlang#1430 jqlang#1624 jqlang#3064
It seems substring thinks length(正xy)==3
but rindex thinks length(正xy)==5
this issue make jsonp parse example in FAQ fails for utf8 inputs
The text was updated successfully, but these errors were encountered: