You would think that code page problems were a thing of the past, but a problem has appeared for me some time between 2022.6.7 and 2022.8.1.
HA 2022.8.1 as a fresh installation will run once, create the .homeassistant directory and process integrations. Web UI is operational. At the next startup, it will however find non-ascii characters in two Json files which it refuses to handle, and exits.
*UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 5585: invalid start byte*
*2022-08-06 11:02:49.365 ERROR (SyncWorker_3) [homeassistant.util.json] Could not parse JSON content: /home/homeassistant/.homeassistant/.storage/core.entity_registry*
*Traceback (most recent call last):*
* File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/util/json.py", line 39, in load_json*
* return orjson.loads(fdesc.read()) # type: ignore[no-any-return]*
* File "/usr/lib/python3.9/codecs.py", line 322, in decode*
* (result, consumed) = self._buffer_decode(data, self.errors, final)*
*UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 11166: invalid start byte*
This did not happen in the 2022.06.7 that I had before. I saw letters like å, ä, and ö in the web interface and it still worked after reboot.
The affected files are core.device_registry and core.entity_registry.
Sure, some of the names containing non-english characters are created outside of HA, e.g. in Google home, but the “degrees” character in ““unit_of_measurement”: “�C”” is from HA itself. This should definitely have been UTF-8.
Im running on a Re:Terminal using Raspbian GNU/Linux 11 (bullseye).
Any clues?
There was such an issue, and it was closed with the answer that the person should follow some Python rule and change locale settings to explicitly use UTF-8. That’s weird. So Debian is only for English-speaking people?
I changed to:
export LC_CTYPE=C.UTF-8
export PYTHONIOENCODING=utf-8:surrogateescape
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
in /etc/profile, deleted .homeassistant and performed a complete reinstallation
But the error persists. I still get e.g. characters 0xE5 and 0xF6 in some json file the second time I try to start homeassistant.
This is still a problem. And you guys think you have it tough? Try being me, with lots of æøå in the names of things, like “Kjøkken” (kitchen)! I had to remove all those, plus the degree sign and the ² character in the core entity and device registry files, and it finally starts. But shouldn’t this be fixed after so long?