I have the string 'abç'which in utf8 is b'ab\xc3\xa7'
I want it in utf-16, but not this way :
b'ab\xc3\xa7'.decode('utf-8').encode('utf-16-be')
which gives me
b'\x00a\x00b\x00\xe7'
the answer I want is the utf-16 code units, that is, a list of int :
[32, 33, 327]
Is there any straightforward way to do that?
And of course, the reverse. Given a list of ints which are utf-16 code units, how do I convert that to utf-8?