B4J Question Incorrect value after conversion

micro

Well-Known Member
Licensed User
Longtime User
This is in reference to the thread https://www.b4x.com/android/forum/threads/2s-complement.66321/
I have a stringbuilder initialized with same value
If i ceck (example) the value to thirteenth position
B4X:
Asc(buffer_st.ToString.SubString2(12,13))
the value is correct = 193 (0xc1)
but after conversion into buffer (byte)
B4X:
Dim b() As Byte
If buffer_st.Length = 0 Then Return
b = conv.StringToBytes(buffer_st, "UTF8")
the value to thirteenth position is -61 (0xFFFFFFC3)
Is incorrect Encoding?
Thanks
 
Top