TawabAlamKhan.com

Ruby Method for encoding Bangla Unicode Text to Hex Value to Send Bangla SMS using SSLWireless

The following ruby method converts an Bengali Text to Hex value.

def encode_for_bangla_sms( text )
	text.encode('utf-16be').unpack('H*').to_s.gsub!(/\W/,'').upcase
end

text_bangla = "১ ২ ৩, ১ ২ ৩ "
text_encoded = encode_for_bangla_sms text_bangla
#09E7002009E8002009E9002C002009E7002009E8002009E90020

SSLWireless providers a different stakeholder id for Bangla SMS. So if you use that along with the hex value, you should receive the Bangla text.