Clean up main()

Retrieve arguments from platform interface so correct encoding is used
on Windows.