2011-06-04 15:40:15 -07:00
|
|
|
if String.method_defined?(:force_encoding)
|
|
|
|
# UTF-8 support is native, so let's route the +"abc" syntax to the native
|
|
|
|
# encode method.
|
|
|
|
|
|
|
|
class String
|
|
|
|
def +@
|
2015-07-17 15:36:22 -07:00
|
|
|
dup.force_encoding('utf-8')
|
2011-06-04 15:40:15 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
require 'encoding/character/utf-8'
|
|
|
|
end
|
|
|
|
|