let code = [104,101,108,108,111,32,119,111,114,108,100];
How to convert a C string (char array) into a Python string when there are non-ASCII characters in the string?
By : Samael
Date : March 29 2020, 07:55 AM
wish helps you I have embedded a Python interpreter in a C program. Suppose the C program reads some bytes from a file into a char array and learns (somehow) that the bytes represent text with a certain encoding (e.g., ISO 8859-1, Windows-1252, or UTF-8). How do I decode the contents of this char array into a Python string? , PyString_Decode does this: