G
Guest
I use the following code to convert a hex string into unicode text. But the
problem is that it seems to stop after the first character and output
consists also of one character. Example...I want to convert "41004200" into
text. Normally it should be "AB" but it displays only the "A".
Dim output As String
Dim intIndex As Integer
Dim j As Byte
Dim ch As Char
For intIndex = 1 To Len(Hex.Text) Step 2
j = CByte("&H" & Mid(Hex.Text, intIndex, 2))
ch = Convert.ToChar(j)
output &= ch.ToString
Next
On Error Resume Next
Str.Text = output
problem is that it seems to stop after the first character and output
consists also of one character. Example...I want to convert "41004200" into
text. Normally it should be "AB" but it displays only the "A".
Dim output As String
Dim intIndex As Integer
Dim j As Byte
Dim ch As Char
For intIndex = 1 To Len(Hex.Text) Step 2
j = CByte("&H" & Mid(Hex.Text, intIndex, 2))
ch = Convert.ToChar(j)
output &= ch.ToString
Next
On Error Resume Next
Str.Text = output