Instead of using a string to specify the encoding, we can specify the encoding with a constant:

```ruby
'abcd'.encode(Encoding::UTF_8)
```