Use QCoreApplication::arguments() for genversion

This prevents issues with locales and unicode paths.
Fixes #1177