solved converting problem #2

Merged
merged 1 commit into from Dec 12, 2011
View
@@ -53,7 +53,7 @@ def is_gsm0338_encoded?(message)
def string_to_hexadecimal_code_points(message)
if message.class.to_s == 'String' && message.encoding.to_s == 'UTF-8'
hex_code = ''
- Iconv.iconv("UCS-2", "utf-8", message).first.each_char {|unicode_char| hex_code += unicode_char.unpack('H*').first}
+ Iconv.iconv("UCS-2BE", "UTF-8", message).first.each_char {|unicode_char| hex_code += unicode_char.unpack('H*').first}
hex_code
else
raise MessageIsNoUtf8String.new("The message is either not a string or not UTF-8 encoded. MESSAGE: #{message}")