]> git.openstreetmap.org Git - rails.git/blob - lib/utf8.rb
Black list 2010 and 2016 imagery for the Canton Schaffhauen
[rails.git] / lib / utf8.rb
1 module UTF8
2   ##
3   # Checks that a string is valid UTF-8 by trying to convert it to UTF-8
4   # using the iconv library, which is in the standard library.
5   def self.valid?(str)
6     return true if str.nil?
7
8     str.valid_encoding?
9   end
10 end