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

fix: utf8 input Substring #288

Closed
wants to merge 3 commits into from
Closed

fix: utf8 input Substring #288

wants to merge 3 commits into from

Conversation

trim21
Copy link
Contributor

@trim21 trim21 commented Dec 25, 2022

fix #286

potential breaking change, because previously lo.Substring didn't handle utf8 input correctly.

ChunkString works because for i := string(...) behave like for i := []rune(string(...)), but we didn't convert ~string to []rune in Substring, string(...)[start:end] doesn't handle utf8.

@codecov-commenter
Copy link

codecov-commenter commented Dec 25, 2022

Codecov Report

Base: 99.28% // Head: 99.28% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (000899c) compared to base (07f7c79).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #288      +/-   ##
==========================================
- Coverage   99.28%   99.28%   -0.01%     
==========================================
  Files          15       15              
  Lines        1971     1958      -13     
==========================================
- Hits         1957     1944      -13     
  Misses         13       13              
  Partials        1        1              
Flag Coverage Δ
unittests 99.28% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
string.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@trim21
Copy link
Contributor Author

trim21 commented Jan 12, 2023

/ping

1 similar comment
@trim21
Copy link
Contributor Author

trim21 commented Feb 20, 2023

/ping

samber added a commit that referenced this pull request Mar 20, 2023
@samber
Copy link
Owner

samber commented Mar 20, 2023

Fixed in #327.

I added tests for the helper. Thanks for the feedback.

@samber samber closed this Mar 20, 2023
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

Successfully merging this pull request may close these issues.

Substring can't handle utf8 characters
3 participants