Skip to content

Instantly share code, notes, and snippets.

@Earlopain
Created December 19, 2024 08:34
Show Gist options
  • Save Earlopain/2f31614eaed89fc67651310d1ea74f9c to your computer and use it in GitHub Desktop.
Save Earlopain/2f31614eaed89fc67651310d1ea74f9c to your computer and use it in GitHub Desktop.
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