Add encoding to spec creation