replace the function call which doesn't crash with invalid utf-8 msg