如何在html textarea中显示以下文本? [英] How can I show following text in html textarea?

查看:209
本文介绍了如何在html textarea中显示以下文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你有一个像下面的字符串。请看看





我把它作为一个图像,这里也没有显示。如果我把这个字符串放在这里,它就成了下面的内容。

  21154537878887GHE\\\D\\\E 
=h2_lin>解决方案

执行此操作:

< textarea> 2&#002; 11&# 001C; 5&安培;#0002; 45&安培;#001C 3安培;#0002; 788&安培;#0019; 87&安培;#0019; GH&安培;#0019; E\\\D\\\E< / textarea的> 请注意,渲染时发生的情况是,所有可以以选定(以css)字体显示的字符都可以正常显示,而大多数浏览器可以回退到Unicode BMP Fallback Font( http://scripts.sil .org / cms / scripts / page.php?site_id = nrsi& item_id = UnicodeBMPFallbackFont ),它可以填补任何字体的空白正在使用。确切的结果将取决于浏览器。


Hi have a String like following. Please take a look

I put it as a image this is not display in here too. If I put that String here It become following.

 21154537878887GHE\u0044\u0045

Now my question, is there any way to put original String to html textarea without changing encoding?

解决方案

Do this:

<textarea>2&#002;11&#001c;5&#0002;45&#001c;3&#0002;788&#0019;87&#0019;GH&#0019;E\u0044\u0045</textarea>

Note that what happens when this is rendered is that all the characters that can be displayed in the chosen (in css) font are displayed normally, while most browsers fall back to the Unicode BMP Fallback Font (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=UnicodeBMPFallbackFont) which simply fills in the gaps in whatever font you might be using. The exact result will be browser-dependent.

这篇关于如何在html textarea中显示以下文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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