Making log functions unicode safe for unknown input.