Just to follow-up on this - we've seen something similar, and the problem ended up being that the FTP client was set to ASCII transfer type - and all the site files were uploaded as ASCII.
Setting the FTP client back to Auto and re-uploading all the XF upgrade files fixed it (after refreshing the browser cache).