Commit 5873251f authored by Ladislav Martincik's avatar Ladislav Martincik

Adding support for Ruby <1.9 versions.

parent 2095b5c0
......@@ -64,15 +64,20 @@ module Pod
# !@group Private methods
# Returns the sanitized text with UTF-8 eliminating invalid characters.
# Returns the sanitized text with UTF-8 eliminating invalid characters if
# Ruby version >=1.9 else will return the text.
#
# @param [String] text
# the text we want to sanitize.
#
# @return [String] The sanitized text.
# @return [String] The sanitized text if Ruby >=1.9 else text.
#
def sanitize_encoding(text)
text.encode('UTF-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '')
if RUBY_VERSION >= '1.9'
text.encode('UTF-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '')
else
text
end
end
#-----------------------------------------------------------------------#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment