From: Tom Hughes Date: Mon, 12 Nov 2012 20:19:07 +0000 (+0000) Subject: Only call force_encoding on ruby 1.9 X-Git-Tag: live~5238 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/0472e6cad4d2c68b0831caa9eeea582f0f297027?hp=461e39f4a5a386a476c88175e072d8015e2ec4fe Only call force_encoding on ruby 1.9 --- diff --git a/lib/potlatch.rb b/lib/potlatch.rb index 35a60dfbb..359492fa7 100644 --- a/lib/potlatch.rb +++ b/lib/potlatch.rb @@ -107,7 +107,7 @@ module Potlatch # Encode string with two-byte length def self.encodestring(n) - n=n.dup.force_encoding("ASCII-8BIT") + n=n.dup.force_encoding("ASCII-8BIT") if n.respond_to?("force_encoding") a,b=n.size.divmod(256) a.chr+b.chr+n end