Fixed misuse of isascii. Also fixes mingw32 build, see http://msdn.microsoft.com/en-us/library/ms235417.aspx