Skip to content

Commit

Permalink
Merge pull request #2 from sjkatz/master
Browse files Browse the repository at this point in the history
Iconv and Ruby 2.0 compatibility.
  • Loading branch information
samlown committed Apr 14, 2014
2 parents 6aedd6a + 595a669 commit 3221a84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/bulksms/account.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# encoding: utf-8

require 'cgi'
require 'iconv'
#require 'iconv'

module Bulksms

Expand Down Expand Up @@ -61,7 +61,8 @@ def params_to_query_string(params)
end

def encode_cgi_string(string)
CGI.escape(Iconv.iconv('ISO-8859-15//ignore', 'UTF-8', string)[0]).gsub(/%[0-9A-F]{2}/) do |match|
#CGI.escape(Iconv.iconv('ISO-8859-15//ignore', 'UTF-8', string)[0]).gsub(/%[0-9A-F]{2}/) do |match|
CGI.escape(string.encode('ISO-8859-15')).gsub(/%[0-9A-F]{2}/) do |match|
code = GSM0338_EXTENDED_MAP[match]
code ? "%BB%#{code}" : match
end
Expand Down
2 changes: 2 additions & 0 deletions lib/bulksms/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def host
'usa.bulksms.com'
when :safrica
'bulksms.2way.co.za'
when :community
'community.bulksms.com'
when :spain
'bulksms.com.es'
else # :international
Expand Down

0 comments on commit 3221a84

Please sign in to comment.