]> git.openstreetmap.org Git - rails.git/blobdiff - lib/utf8.rb
Bump eslint from 9.9.0 to 9.9.1
[rails.git] / lib / utf8.rb
index 5f0d219baa10293e104fb7decfa916ac0ea79100..613e3005ea68aedf5815f0c37e023fda557ced8d 100644 (file)
@@ -4,11 +4,7 @@ module UTF8
   # using the iconv library, which is in the standard library.
   def self.valid?(str)
     return true if str.nil?
-    Iconv.conv("UTF-8", "UTF-8", str)
-    return true
-    
-  rescue
-    return false
-  end  
-end
 
+    str.valid_encoding?
+  end
+end