0

Apologies if this question has been previously answered, I was unable to find an explanation. I've created a script in VBScript to encrypt an user input and match to an already encrypted password. I ran into some issues along the way and managed to deduce to the following.

I have a byte array (1 to 2) as values (1, 16). I am then defining a string with the value of the array as per below:

Dim bytArr(1 To 2) As Byte
Dim output As String
bytArr(1) = 16
bytArr(2) = 1

output = bytArr
Debug.Print output

The output I get is Ð (Eth) ASCII Value 208. Could someone please explain how the byte array is converted to this character?

1 Answer 1

1

Get above statements together keeping in mind endianness (byte order) of the computer architecture: Intel x86 processors use little-endian, so byte array (0x10, 0x01) is the same as unicode string U+0110.

Charaters are amalgamated via flagrant mojibake case. For proof, please use Asc and AscW Functions as follows: Debug.Print output, Asc(output), AscW(output) with different console code pages, e.g. under chcp 852 and chcp 1250.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi JosefZ, Thanks for the input, however I'm not sure I fully understand. When i run the script as per the above I receive the output from 'output = bytArr' as 208. I assumed this related to the ASCII value and therefore corresponded with the lowercase eth (208) however if I attempted to show the character by altering the script it would show capital letter eth (209). Could you please explain exactly how the array 16, 1 is amalgamated to create the value 208?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.