I am trying to combine characters from chr(0) - chr(255) to create a character above chr(256) is it possible to achieve this? here is a basic code of what I am doing:
import pyclip
rand_char = [random.randint(0, 255) for i in range(random.randint(1,4))]
# what to do here?
combined_char = create_higher_char(rand_char)
pyclip.copy(combined_char)
Basically for example you can get chr(1499) via : '\xd7\x9b'
>>> chr(1499)
'כ'
>>> chr(1499).encode()
b'\xd7\x9b'
So when I get '\xd7\x9b' on rand_char I should be able to copy chr(1499) instead of '\xd7\x9b' which has a value of :
>>> [ord(x) for x in '\xd7\x9b']
[215, 155]
I tried creating a list of possible combinations of encoded characters but some characters do not have .encode()
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 0: surrogates not allowed
How is it possible to get the value 1499 from [215, 155]?