Encode the environment before using it.

This allows us to launch on windows.