use errors='replace' in str.[en|de]code