Sed 和 UTF-8 编码 [英] Sed and UTF-8 encoding

查看:26
本文介绍了Sed 和 UTF-8 编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SSH (Putty) 中,我使用命令替换以 UTF-8 编码的文件中的一些文本

In SSH (Putty) I'm using a command to replace some text in a file which is encoded in UTF-8

例如

cd ~/public_html/app/Config;sed -i 's/ADDRESS_SSH/l'adresse à été Correctement intégréé/g' param.php;

在文件中一切正常,但在浏览器中显示时,重音很奇怪在验证文件 param.php 时,我发现它的编码从 UTF-8 更改为 Europe de L'Ouest

In the file all is OK but when displaying in the browser the accents are strange When verifing the file param.php I found that it's encoding was changing from UTF-8 to Europe de L'Ouest

.xml 文件也有同样的问题

Same problem for .xml file too

在不更改编码的情况下使用 sed 或添加其他 ssh 行以在 UTF-8 中重新编码新的 php 和 xml 文件有什么帮助吗?

Any help to use sed without changing the encoding or maybe to add an other ssh line for rencoding the php and xml files newly in UTF-8 ?

最好的问候和谢谢

推荐答案

It was on Putty configuration ==> Translation ==> Received data假定在哪个字符集 ==> 选择 UTF-8最好的问候

It was on Putty configuration ==> Translation ==> Received data assumed to be in which character set ==> Choose UTF-8 Best regards

这篇关于Sed 和 UTF-8 编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆