I was trying Basics embedding Python in C++ and when i run this code i get error "SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf4 in position 10 : invalid continuation byte". I am not able to figure out what's wrong in this. I encoded this txt on Pycharm it worked perfectly fine but not when i try to embed this with C++. Thanking in advance for the help
PyObject* pInt;
Py_Initialize();
PyRun_SimpleString("txt = u\"flag_for_Côte_d’Ivoire\"\nx = txt.encode()\nprint(x)");
Py_Finalize();
printf("\nPress any key to exit...\n");
if(!_getch()) _getch();
return 0;
if i only do
PyRun_SimpleString("txt = u\"flag_for_Côte_d’Ivoire\"")
it fails for that too. Python Version which i am using is Python 3.7.3 and on windows VS 2008