X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0d3a9ed9cb47ce3b89ea9eaffbb589f9a9ff6d22..c55c6ae48c3f90ce9d2eb075c6e417ea025ad809:/lib/potlatch.rb diff --git a/lib/potlatch.rb b/lib/potlatch.rb index 919eb0122..359492fa7 100644 --- a/lib/potlatch.rb +++ b/lib/potlatch.rb @@ -106,7 +106,8 @@ module Potlatch end # Encode string with two-byte length - def self.encodestring(n) + def self.encodestring(n) + 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