log a string without valid encoding is useless