Encoding for .platform.app.yaml file?
Eric Matthes
Hi, I’m trying to help someone push a Django project to Platform.sh. When running the platform push command, they got an error:
E: Error parsing configuration files:
- applications: Error loading data: 'utf-8' codec can't decode byte 0xff in postion 0: invalid start byte
I looked at their .platform.app.yaml file, and it seems to have a utf-16 encoding. Do config files have to be utf-8 encoded?
0
Comments
Hi @ehmatthes ! Let me check on that - in the meantime, are you able to share the
.platform.app.yamlfile with us?Sure, here’s a tiny repo with the .platform.app.yaml file, and a Python file that reads the yaml file. The yaml file is only read if the utf-16 encoding is stated explicitly.
The person was pushing from an Ubuntu WSL instance. I think this issue might be relevant, assuming Platform_sh requires config files to be in utf-8.
Tomorrow I can use this config file in a test project and see what happens. Currently I’m expecting that push to fail, and if I then rewrite the file with an explicit utf-8 encoding I would expect the push to succeed.
I posted a repo demonstrating that Platformsh requires config files to have a UTF-8 encoding. More specifically, deployment fails with a UTF-16 encoding, and then succeeds after a conversion to UTF-16 encoding.
Is it a documented requirement that config files have a UTF-8 encoding?
(I’m aware enough of encoding issues to sort them out when I encounter them, but I don’t have a deep enough understanding to know whether it would make sense to accommodate encodings other than UTF-8 in config files.)
Please sign in to leave a comment.