fix code page problem for tui on windows
fix build script for mac