rightscale/right_aws — pull request #140 by tvongaza (2012-09-04 22:12:17+00:00)
Title: Incorrect escaping of unicode with ruby 1.9.3

Given a param of "document_versions/65/unicode - レミ" amz_escape will incorrectly escape only the first byte of the unicode characters. This is due to $.size returning the strings character length in 1.9 vs the strings byte length. Changing $1.size to $1.bytesize fixes the issue.

The regex change removes the following warning:
/right_aws-3.0.4/lib/awsbase/right_awsbase.rb:50: warning: regexp match /.../n against to UTF-8 string

Code works in both 1.9.3 and 1.8.7.