Last active
February 8, 2021 04:20
-
-
Save keithrbennett/df0d94f44bad804cc35bb112fa0c5e84 to your computer and use it in GitHub Desktop.
Removes Unicode "\u200B" zero width spaces; useful for copying source code from O'Reilly learning books
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# strip-zero-width-spaces.rb | |
# | |
# Removes Unicode "\u200B" zero width spaces; useful for copying source code from O'Reilly learning books | |
# | |
# Usage: | |
# | |
# strip-zero-width-spaces.rb < original_file > new_stripped_file | |
STDIN.read.each_char do |c| | |
print c unless c == "\u200B" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment