Dear All,

Actually I'm facing problem when I'm trying to write in perl same function
which is available in VB and Function code is mention below

Public Function EncodeArabic(ByVal arabicString As String) As String
        Dim _targetEncoding As System.Text.Encoding
        Dim _encodedCharsArray() As Byte
        Dim _resultString As String = String.Empty
        '1256 is the code page for windows arabic

        ' 1201 is the code page of Unicode big endian
        _targetEncoding = System.Text.Encoding.GetEncoding(1201)
        _encodedCharsArray = _targetEncoding.GetBytes(arabicString)
        '_resultString = ByteToHexadecimal(_encodedCharsArray)
        _resultString = ByteToHexadecimal(_encodedCharsArray)
        Return _resultString
    End Function
    Public Function ByteToHexadecimal(ByVal imageByteArray() As Byte) As
String

        Dim hexString As String = String.Empty

        Dim i As Integer
        For i = 0 To imageByteArray.Length - 1 Step i + 1

            hexString += imageByteArray(i).ToString("x2") 'it was X2

        Next

        Return hexString

    End Function

____________________________________________________________________________
________

Actually I'm want to write this function to send SMS which supports
ByteToHexadecimal using http request but text is in Arabic. So any one can
help me to solve this problem.

Regards,
Nayeem.

Reply via email to