# HG changeset patch # User GP Orcullo # Date 1666940167 -28800 # Node ID 8db203310f6853291d6c5d55be8910999674e5c8 # Parent ca814b175391c16d857931e276cb23d12640e155 fix ctypes encoding diff -r ca814b175391 -r 8db203310f68 runtime/typemapping.py --- a/runtime/typemapping.py Fri Oct 28 14:53:23 2022 +0800 +++ b/runtime/typemapping.py Fri Oct 28 14:56:07 2022 +0800 @@ -4,13 +4,12 @@ # See COPYING.Runtime file for copyrights details. # - import ctypes from ctypes import * from datetime import timedelta as td -ctypes.pythonapi.PyString_AsString.argtypes = (ctypes.c_void_p,) -ctypes.pythonapi.PyString_AsString.restype = ctypes.POINTER(ctypes.c_char) +ctypes.pythonapi.PyUnicode_AsUTF8.argtypes = (ctypes.c_void_p,) +ctypes.pythonapi.PyUnicode_AsUTF8.restype = ctypes.POINTER(ctypes.c_char) class IEC_STRING(Structure):