Created
February 24, 2013 13:20
-
-
Save takehiko/5023820 to your computer and use it in GitHub Desktop.
A patch for removing "iconv" from ruby-aaws-0.8.1.
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.orig.rb 2013-02-24 22:10:49.823223500 +0900 | |
--- aws.rb 2013-02-24 22:14:02.582248700 +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' | |
*************** | |
*** 188,194 **** | |
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 | |
--- 188,193 ---- | |
*************** | |
*** 198,204 **** | |
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 | |
--- 197,203 ---- | |
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