primo
19-08-2019, 11:47
when we peek the Unicode character:
string uniode = "Я"
hx_str = PEEKHex$(strptr(unicode), 2)
we get correctly D0AF like displayed in this page for that Character:
https://www.compart.com/en/unicode/U+042F
under the title: UTF-8 Encoding: 0xD0 0xAF
and this is equivalent to the Decimal 53423
15*16^0 + 10*16^1 + 0*16^2 +13*16^3 = 15 + 160 + 0 + 53248 = 53423
but i got from the following code -12113
hex to decimal calculator : https://tools.keycdn.com/hex-converter?value=D0AF&input=hex
Uses "Console"
string unicode = "Я"
string hx_str
hx_str = PEEKHex$(strptr(unicode), 2)
printl hx_str
hx_str = "&h" + hx_str
print val(hx_str)
waitkey
PS:
it is possible because 65535 = 53248 + 12113
string uniode = "Я"
hx_str = PEEKHex$(strptr(unicode), 2)
we get correctly D0AF like displayed in this page for that Character:
https://www.compart.com/en/unicode/U+042F
under the title: UTF-8 Encoding: 0xD0 0xAF
and this is equivalent to the Decimal 53423
15*16^0 + 10*16^1 + 0*16^2 +13*16^3 = 15 + 160 + 0 + 53248 = 53423
but i got from the following code -12113
hex to decimal calculator : https://tools.keycdn.com/hex-converter?value=D0AF&input=hex
Uses "Console"
string unicode = "Я"
string hx_str
hx_str = PEEKHex$(strptr(unicode), 2)
printl hx_str
hx_str = "&h" + hx_str
print val(hx_str)
waitkey
PS:
it is possible because 65535 = 53248 + 12113