[core] Decode environment variables with filesystem encoding (Fixes #3854, Fixes...