Created
December 19, 2024 08:34
-
-
Save Earlopain/2f31614eaed89fc67651310d1ea74f9c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
bounds = [] | |
valid1 = true | |
valid2 = true | |
(0..(0x110000 - 1)).each do |num| | |
valid1 = valid2 | |
num.chr(Encoding::UTF_8) | |
valid2 = true | |
rescue RangeError | |
valid2 = false | |
ensure | |
bounds << num if valid1 != valid2 | |
end | |
pp bounds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment