# Markdown formatting support
gem "redcarpet"
-# Character conversion support for ruby 1.8
-gem "iconv", "= 0.1", :platforms => :ruby_18
-
# Load libxml support for XML parsing and generation
gem "libxml-ruby", ">= 2.0.5", :require => "libxml"
http_accept_language (2.0.5)
httpclient (2.6.0.1)
i18n (0.7.0)
- iconv (0.1)
jquery-rails (4.0.3)
rails-dom-testing (~> 1.0)
railties (>= 4.2.0)
htmlentities
http_accept_language (~> 2.0.0)
httpclient
- iconv (= 0.1)
jquery-rails
json
jsonify-rails
##
# Checks that a string is valid UTF-8 by trying to convert it to UTF-8
# using the iconv library, which is in the standard library.
- if "".respond_to?("valid_encoding?")
- def self.valid?(str)
- return true if str.nil?
- str.valid_encoding?
- end
- else
- require "iconv"
-
- def self.valid?(str)
- return true if str.nil?
- Iconv.conv("UTF-8", "UTF-8", str)
- return true
- rescue
- return false
- end
+ def self.valid?(str)
+ return true if str.nil?
+ str.valid_encoding?
end
end