Fix compile problem on MinGW and force UTF-8 as encoding.