Fix text encoding for GUI (BasicIO) mode

- Fix encoding when using a GUI on non-ascii langages (eg russian)
- See discussion in pull request #30 for more info