Detect nonANSI even too close to file end

Based on TortoiseSVN revision 24173

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>