保留文本区域内的字符集 [英] Preserving the Character set inside text area

查看:85
本文介绍了保留文本区域内的字符集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI


我想在文本区域内显示大型XML的内容,以便用户能够编辑它。但是XML由诸如& amp;之类的字符组成。 &安培; QUOT;由as& amp解释和分别。

但如果情况确实如此,后端系统无法读取它们。我使用了< xmp>,但它已经被弃用了,而且它在文本区域内不起作用。有人可以帮我这个吗?


简称:& amp;应显示为& amp;本身而不是&在textarea内。


Vinoth

解决方案

javascript我肯定可以做正确的角色转义,但我不知道怎么做自己动手吧。您也可以使用PHP或perl或其他脚本语言来执行服务器端。基本上& 符号需要转换为& amp; ,因此& amp; 将成为& amp; amp; amp; 等等等。



HI


我想显示内容文本区域内的大型XML,以便用户能够编辑它。但是XML由诸如& amp;之类的字符组成。 &安培; QUOT;由as& amp解释和分别。

但如果情况确实如此,后端系统无法读取它们。我使用了< xmp>,但它已经被弃用了,而且它在文本区域内不起作用。有人可以帮我这个吗?


简称:& amp;应显示为& amp;本身而不是&在textarea内。


Vinoth



也许这更像是一个XML问题?


< blockquote class =post_quotes>
javascript我相信可以做正确的角色逃脱,但我不知道该怎么做自己。您也可以使用PHP或perl或其他脚本语言来执行服务器端。基本上& 符号需要转换为& amp; ,因此& amp; 将成为& amp; amp; amp; 等等等等。



是的。基本上这一轮将是替换所有& amp; amp;与& amp; amp;等等我们最终在服务器端做了什么。但我想知道在客户端本身是否可以做任何事情。


非常感谢。


HI

I want to display the contents of a big XML inside a text area so that the user would be able to edit it. But the XML consists of characters such as &amp; &quot; which are interpreted by as & and " respectively.
But if this going to be the case the backend systems could not read them. I used <xmp>, but it is already deprecated and further it would not work inside text area. Could somebody help me with this.

in short : &amp; should be displayed as &amp; itself and not & inside the textarea.

Vinoth

解决方案

javascript I am sure can do the proper character escaping, but I don''t know how to do it myself. You can also do it server side with PHP or perl or other scripting language. Bascially the & symbol needs to converted to &amp; so &amp; would become &amp;amp; etc etc etc.


HI

I want to display the contents of a big XML inside a text area so that the user would be able to edit it. But the XML consists of characters such as &amp; &quot; which are interpreted by as & and " respectively.
But if this going to be the case the backend systems could not read them. I used <xmp>, but it is already deprecated and further it would not work inside text area. Could somebody help me with this.

in short : &amp; should be displayed as &amp; itself and not & inside the textarea.

Vinoth

Maybe this is more of an XML question?


javascript I am sure can do the proper character escaping, but I don''t know how to do it myself. You can also do it server side with PHP or perl or other scripting language. Bascially the & symbol needs to converted to &amp; so &amp; would become &amp;amp; etc etc etc.

Yeah.Basically the round about would be to do a replace all of &amp; with &amp;amp; and so on which we eventually did in the server side. But I wanted to know if anything could be done in the client side itself.

Thanks a lot anyways.


这篇关于保留文本区域内的字符集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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