I'm running a Python Script ("run whether user is logged on or not") on Windows Server 2016 every hour.
The Python Script basically just calls an API and exports the results into the JSON file. The problem is, that sometimes JSON file contains weird characters in a few fields. For example, "7494690" would be displayed as "�Qޘ'".
If I'm logged into the server via RDP, then files are coming out fine 10 out of 10 times. If I'm logged out and tasks run automatically, then most often (not always!) I get weird characters - roughly 8-9 times out of 10.
I've changed the user, but the issue persists. Any ideas..?
Edit: There's a new symptom. I've added the same task on a task scheduler twice. On the first attempt, I'm getting a corrupted file. On the second attempt, the file turns out fine. Could it be that Windows somehow picks up the the wrong locale/encoding?