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

Add Unicode chars mode: "goawk -c" or Config.Chars=true #243

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

benhoyt
Copy link
Owner

@benhoyt benhoyt commented Sep 18, 2024

Use chars mode in index(), length(), match(), and substr(). This is based on the work done in #83, but the default is the other way around (default = bytes mode, which is the same as it is now).

Also only use Unicode chars in printf %c if chars mode is enabled. This changes the default introduced in #236 / v1.28.0 for that feature.

This won't please everyone (defaults are the same as mawk, but not Gawk). But it's a pragmatic solution that allows people to opt into Unicode support if they want, and if they can handle the O(N) behaviour of those functions.

This is based on the work done in
#83
but the default is the other way around (default = bytes mode).
@benhoyt benhoyt merged commit 0df77ff into master Sep 18, 2024
11 checks passed
@benhoyt benhoyt deleted the unicode-chars branch September 18, 2024 20:46
@JohnEarnest
Copy link

Excellent! With these changes, lila now passes its full test suite under goawk's default settings.

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.

2 participants