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

awk: split record into runes for empty FS #292

Merged
merged 1 commit into from
Oct 29, 2019

Conversation

fhs
Copy link
Contributor

@fhs fhs commented Oct 9, 2019

awk was splitting records into bytes instead of runes for empty FS.
For example, this was printing only the first byte of the utf-8 encoding
of é:

echo é | awk 'BEGIN{FS=""}{print $1}'

The change just copies how the split function handles runes.

Originally reported by kris on twitter:
https://twitter.com/p9luv/status/1180436083433201665

awk was splitting records into bytes instead of runes for empty FS.
For example, this was printing only the first byte of the utf-8 encoding
of é:

	echo é | awk 'BEGIN{FS=""}{print $1}'

The change just copies how the `split` function handles runes.

Originally reported by kris on twitter:
https://twitter.com/p9luv/status/1180436083433201665
@dancrossnyc dancrossnyc merged commit 1309450 into 9fans:master Oct 29, 2019
@fhs fhs deleted the awk-empty-fs branch October 29, 2019 15:06
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