For backward compatibility reasons I want to implement the String#codepoints
ruby method (introduced in 1.9.1
).
I am thinking
def codepoints(str)
str.split('').map(&:ord)
end
but I am concerned that #ord
will not work properly with earlier versions of ruby.