hey guys I have a problem with casting every char of a string into a integervalue to pass it into a database.

I already know that there is a function like str.charCodeAt(i) to get an integer value, but for larger number above 180 it suddenly does not work.

here is an example

0xfd = 253 with charCodeAt(i) i receive 65533 the same holds for 0xb4 = 180 with charCodeAt(i) i get also the same wrong value.

So where is my problem? Is there maybe another way of casting these values?

Furthermore here is an example of the actual string i receive from the server..

<Buffer 02 00 01 00 02 00 43 64 fd fd 00 01 00 b4 00 85 27 76 21 31 31 ee 8e 86 03 02 00 01 00 02 00 24 64 fd fd 00 01 01 b4 00 c3 27 76 21 31 31 ed 99 5c 03>

And here is what comes out with charCodeAt():

2
0
1
0
2
0
40
100
65533
65533
0
1
0
65533
0
65533
39
118
33
49
49
65533
65533
94
3

This string is not the exact from the buffer above but you will see the bigger values dont match up at all..

I thank you for your help and attention..