Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Make str casing methods multi-byte aware #186

Merged
merged 1 commit into from Jan 22, 2017
Merged

Make str casing methods multi-byte aware #186

merged 1 commit into from Jan 22, 2017

Conversation

meadori
Copy link
Contributor

@meadori meadori commented Jan 21, 2017

In the course of reviewing #116 it came to light that
some of the other str methods that involve changing
case do not handle multi-byte characters correctly.
This patch fixes that.

Copy link
Contributor

@trotterdylan trotterdylan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thanks for putting it together! I have one small comment.

@@ -157,29 +158,35 @@ func strAdd(f *Frame, v, w *Object) (*Object, *BaseException) {
return NewStr(stringV + stringW).ToObject(), nil
}

func toLower(b byte) byte {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please group helper functions to the bottom of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks for the review!

In the course of reviewing #116 it came to light that
some of the other `str` methods that involve changing
case do not handle multi-byte characters correctly.
This patch fixes that.
@trotterdylan trotterdylan merged commit 9d3c4b3 into google:master Jan 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants