lib/s3sync/S3encoder.rb in cprobert-s3sync-1.3.6 vs lib/s3sync/S3encoder.rb in cprobert-s3sync-1.3.7
- old
+ new
@@ -37,10 +37,13 @@
@@useUTF8InEscape = false
attr_writer :useUTF8InEscape
def S3Extend_escape(string)
result = string
- result = Iconv.iconv("UTF-8", @nativeCharacterEncoding, string).join if @useUTF8InEscape
+
+ result = string.encode(@nativeCharacterEncoding, :invalid => :replace, :undef => :replace, :replace => "-") if @useUTF8InEscape
+ #result = Iconv.iconv("UTF-8", @nativeCharacterEncoding, string).join if @useUTF8InEscape
+
result = S3Extend_escape_orig(result)
result.gsub!(/%2f/i, "/") if @exemptSlashesInEscape
result.gsub!("+", "%20") if @usePercent20InEscape
result
end