Can set encoding to `Encoding::UTF_8_MAC` here. Otherwise it'll use the default external encoding. Then the final line is just `out.encode! Encoding::UTF_8`