Hi,
I'm trying to convert Arabic to hex using binary format and binary scan. But the format seems to be not working correctly. Below is the code snippet for reference.
set message {قد تم تشغيل خدمةCLIP التي اشتركت بها. }
puts "String before : $message"
set mess [ConstructArabicMessage $message]
puts $mess
proc ConstructArabicMessage {message} {
.
.
.
.
set formatA(m_length) c
set formatA(short_message) a*
set m_length [string length $message]
set SubmitMessageBody_Rest ""
foreach pField {m_length short_message} {
set bin [binary format $formatA($pField) [subst \$$pField]]
append SubmitMessageBody_Rest $bin
binary scan $bin H* decode
puts $decode
}
.
.
.
.
}
Thanks in advance.
I'm trying to convert Arabic to hex using binary format and binary scan. But the format seems to be not working correctly. Below is the code snippet for reference.
set message {قد تم تشغيل خدمةCLIP التي اشتركت بها. }
puts "String before : $message"
set mess [ConstructArabicMessage $message]
puts $mess
proc ConstructArabicMessage {message} {
.
.
.
.
set formatA(m_length) c
set formatA(short_message) a*
set m_length [string length $message]
set SubmitMessageBody_Rest ""
foreach pField {m_length short_message} {
set bin [binary format $formatA($pField) [subst \$$pField]]
append SubmitMessageBody_Rest $bin
binary scan $bin H* decode
puts $decode
}
.
.
.
.
}
Thanks in advance.