Character encoding in pjsua2 for Python 3.6

Антон Каменский
Sat, Feb 13, 2021 12:29 PM

Hello, guys!
 
I’m compiling pjsip with mingw-w64 (i686-7.2.0-posix-dwarf-rt_v5-rev1) on Windows 8.1 (64) Russian lang for Python 3.6 (32).
For pjsip 2.8 module pjsua2 worked fine. I could get any strings decoding them with decode("cp1251") and run any function setting string params with corresponding encode function. Example for setting the codec priority:
self._lib.codecSetPriority("PCMU/8000/1".encode("cp1251"), 255) I think I got raw encoded strings from pjsua2. That’s why it worked.
Since pjsip 2.9 I can’t get it to work because strings that I got from pjsua2 are unicode strings. Encode and decode function can’t help.
 
Could anyone push me in the right direction to solve this issue?
 
С уважением, Каменский Антон.

Hello, guys!   I’m compiling pjsip with mingw-w64 (i686-7.2.0-posix-dwarf-rt_v5-rev1) on Windows 8.1 (64) Russian lang for Python 3.6 (32). For pjsip 2.8 module pjsua2 worked fine. I could get any strings decoding them with decode("cp1251") and run any function setting string params with corresponding encode function. Example for setting the codec priority: self._lib.codecSetPriority("PCMU/8000/1".encode("cp1251"), 255) I think I got raw encoded strings from pjsua2. That’s why it worked. Since pjsip 2.9 I can’t get it to work because strings that I got from pjsua2 are unicode strings. Encode and decode function can’t help.   Could anyone push me in the right direction to solve this issue?   С уважением, Каменский Антон.