the problem is that `header.decoded` retuned `nil` and below `transcode_to_utf8` expects a string to call `encode` on. I think simply replacing with `header.decoded.to_s` will correctly solve this.