-
-
Save lukeredpath/7ae65630cce67f5081cf to your computer and use it in GitHub Desktop.
This file contains 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
This patch allows passing the 'unicode' flag to the Clicktell HTTP API. If set, | |
it will be passed verbatim to Clickatell as an HTTP request parameter. It is | |
expected that it's set to either 0 or 1. If set to 1, the message text must be | |
a hexstring of the UCS-2 representation of the string, as with the following | |
Ruby snippet: | |
ucs2 = Iconv.conv('UCS-2', 'UTF-8', text) | |
hexstring = ucs2.unpack("H*") | |
100830 Marc Haisenko | |
Index: lib/clickatell/api.rb | |
=================================================================== | |
--- lib/clickatell/api.rb (revision 1010) | |
+++ lib/clickatell/api.rb (working copy) | |
@@ -75,7 +75,7 @@ | |
# :client_message_id - user specified message id that can be used in place of Clickatell issued API message ID for querying message | |
# Returns a new message ID if successful. | |
def send_message(recipient, message_text, opts={}) | |
- valid_options = opts.only(:from, :mo, :callback, :climsgid) | |
+ valid_options = opts.only(:from, :mo, :callback, :climsgid, :unicode) | |
valid_options.merge!(:req_feat => '48') if valid_options[:from] | |
valid_options.merge!(:mo => '1') if opts[:set_mobile_originated] | |
valid_options.merge!(:climsgid => opts[:client_message_id]) if opts[:client_message_id] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment