String#ord is not supported in Ruby 1.8.7, so hard-code the code point of "~"