set :undef to str.encode; broken spec