Last active
December 14, 2015 03:48
-
-
Save takehiko/5023480 to your computer and use it in GitHub Desktop.
A patch for removing "iconv" from ruby-aaws-0.7.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** aws.rb.orig 2013-02-24 19:27:57.448147103 +0900 | |
--- aws.rb 2013-02-24 21:23:29.332241237 +0900 | |
*************** | |
*** 9,15 **** | |
require 'amazon' | |
require 'amazon/aws/cache' | |
require 'enumerator' | |
! require 'iconv' | |
require 'rexml/document' | |
require 'uri' | |
--- 9,15 ---- | |
require 'amazon' | |
require 'amazon/aws/cache' | |
require 'enumerator' | |
! require 'kconv' | |
require 'rexml/document' | |
require 'uri' | |
*************** | |
*** 183,189 **** | |
def AWS.assemble_query(items, encoding=nil) # :nodoc: | |
query = '' | |
- @@encodings[encoding] ||= Iconv.new( 'utf-8', encoding ) if encoding | |
# We must sort the items into an array to get reproducible ordering | |
# of the query parameters. Otherwise, URL caching would not work. We | |
--- 183,188 ---- | |
*************** | |
*** 193,199 **** | |
items.sort { |a,b| a.to_s <=> b.to_s }.each do |k, v| | |
if encoding | |
query << '&%s=%s' % | |
! [ k, Amazon.url_encode( @@encodings[encoding].iconv( v.to_s ) ) ] | |
else | |
query << '&%s=%s' % [ k, Amazon.url_encode( v.to_s ) ] | |
end | |
--- 192,198 ---- | |
items.sort { |a,b| a.to_s <=> b.to_s }.each do |k, v| | |
if encoding | |
query << '&%s=%s' % | |
! [ k, Amazon.url_encode( v.to_s.toutf8 ) ] | |
else | |
query << '&%s=%s' % [ k, Amazon.url_encode( v.to_s ) ] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment