rstrip(str)
Does Unicode-aware rstrip
# File activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb, line 222 def rstrip(str) str.gsub(UNICODE_TRAILERS_PAT, '') end