今天遇到一个进程coredump, 在调试时有几个奇怪的现象:
1. 在gdb的时候发现源码和gdb提示的行号对应不起来;
2. 然后用svn查看日志的时候,打开文件提示cannot show diff because of inconsistent newlines in the file.
此时我第一感觉就是源文件里有非法字符,于是用notepad++打开:
发现文件格式是gb2312编码格式,且是以LF结尾的unix换行风格,但是发现有几个CR字符,把他们删掉统一风格;
因为这个文件存在不同编码的汉字注释,我就想顺便把它们也统一一下,以后都用utf-8.于是使用encoding->convert to utf-8转换编码;
再进行编译提示错误如下:
tpn_pu_main.c:1: error: stray '\357' in program
tpn_pu_main.c:1: error: stray '\273' in program
tpn_pu_main.c:1: error: stray '\277' in pro