易语言的换行符在linux下乱码的解决办法

2014年02月20日

原创内容,转载请注明出处:https://www.myzhenai.com/thread-16148-1-1.html https://www.myzhenai.com.cn/post/1710.html
在windows下用易语言编写的程序创建了一个iptables脚本,但是我将脚本scp到linux服务器上运行的时候却发生错误了.原来是文档里每行的末尾都被加上了^M,所以才会出现错误.
‘ptables v1.4.7: Invalid target name `DROP
Try `iptables -h’ or ‘iptables –help’ for more information.
我查找了网络上才知道,原来问题出在windows系统和linux系统对换行符的机制是不一样的. 在windows下换行符是/r/n linux下换行符是/n 在易语言里的#换行符常量刚好就是{13,10}也就是/r/n. 知道了这点对我们来说就简单了.只要将这个/r替换掉就可以了. 代码是使用 字符(13) 替换成“”空白字符就可以了.

易语言 换行符 linux 乱码 解决 办法

易语言的换行符在linux下乱码的解决办法


易语言 换行符 linux 乱码 解决 办法

易语言的换行符在linux下乱码的解决办法


易语言 换行符 linux 乱码 解决 办法

易语言的换行符在linux下乱码的解决办法


易语言 换行符 linux 乱码 解决 办法

易语言的换行符在linux下乱码的解决办法


sicnature ---------------------------------------------------------------------
Your current IP address is: 3.80.24.244
Your IP address location: 美国弗吉尼亚阿什本
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://www.myzhenai.com/post/1710.html

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注