Hi all
I'm trying to make sense of the encoding of strings coming and going between Basic and Python.
Our Universe database stores its data using OEM encoding, so to pass data to Python we do a series of transformations inside Basic to convert them to UTF-8.
Now I want to pass this OEM strings, as they are, directly into Python and do the conversion there, but I'm having some trouble.
ALL.CHAR.STR=''
ALL.CHAR.STR=ALL.CHAR.STR:CHAR(1):CHAR(2):CHAR(3):CHAR(4):CHAR(5):CHAR(6):CHAR(7):CHAR(8):CHAR(9):CHAR(10):CHAR(11):CHAR(12):CHAR(13):CHAR(14):CHAR(15)
* rest of characters...
ALL.CHAR.STR=ALL.CHAR.STR:CHAR(241):CHAR(242):CHAR(243):CHAR(244):CHAR(245):CHAR(246):CHAR(247):CHAR(248):CHAR(249):CHAR(250):CHAR(251):CHAR(252):CHAR(253):CHAR(254):CHAR(255)
RESPUESTA=PyCallFunction('encoding_test','test_encoding', ALL.CHAR.STR)
On the Python side I'm doing this
def test_encoding(universe_str: str) -> str:
for c in universe_str:
print(f'{ord(c)}')
return 'OK'
This prints the following values:
1
2
3
4
...
125
126
127
65533
65533
...
65533
65533
How can I get the characters in Python and convert them to UTF-8?
------------------------------
Héctor Cortiguera
Quiter Servicios Informaticos SL
------------------------------
