Fixed non-cp1251 characters handling in python wrapper