<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Unicode to HTML converter</title>
</head> <body>
<div id="main">
<script type="text/javascript" charset="utf-8">
//from: http://www.unicodetools.com/unicode/convert-to-html.php
function a(b) {
var c= '';
for(i=0; i<b.length; i++){
if(b.charCodeAt(i)>127){ c += '&#' + b.charCodeAt(i) + ';'; }else{ c += b.charAt(i); }
}
document.forms.conversionForm.outputText.value = c;
}
function sampleText(){
document.forms.conversionForm.inputText.value = "Thére Àre sôme spëcial charâcters ïn thìs têxt 塗聚文";
}
</script>
<h2>Convert special characters to HTML</h2>
<p>
With this tool you are able to encode special characters (chars like 'áèïüñ' '塗聚文'...)
to HTML code. The advantage of using special HTML codes instead of the normal characters is
that the HTML codes will be readable by most users, no matter what charset is used.</p>
<p>
Copy your normal text below. <a href="javascript:sampleText()">Insert sample text</a><br/>
<form name="conversionForm" method="post">
<textarea name="inputText" style="width:400px;height:200px;"></textarea><br/>
<input type="button" name="convert" value="Convert" onclick="a(document.forms.conversionForm.inputText.value)"/>
<br/><br/>Your HTML encoded text:<br/>
<textarea name="outputText" readonly="readonly" style="width:400px;height:200px;"></textarea><br/>
</form>
</p>
</div>
</body> </html>

javascript: Convert special characters to HTML的更多相关文章

  1. How to use special characters in XML?

    https://dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.html Because X ...

  2. JavaScript – Convert Image to Base64 String

    From: https://bytenota.com/javascript-convert-image-to-base64-string/ his post shows you two approac ...

  3. [Javascript] Convert a Callback-Based JavaScript Function to a Promise-Based One

    Sometimes, you might want to convert a JavaScript function that accepts a callback to one that retur ...

  4. [Javascript] Convert a forEach method to generator

    For example we have a 'forEach' method which can loop though a linked list: forEach(fn) { let node = ...

  5. How to enter special characters like “&” in oracle database? [duplicate]

    SQL> set define off; or use Try 'Java_22 '||'&'||' Oracle_14'

  6. 六个字符,带你领略JavaScript (js的艺术编写)

    正文从这开始- JavaScript是一门神奇且奇妙的编程语言,我们有时候用它来写一些看似疯狂的代码,但这些代码依然可被执行且运行结果十分有趣.JavaScript 试图帮助我们将一些数据类型转化为我 ...

  7. PHP7函数大全(4553个函数)

    转载来自: http://www.infocool.net/kb/PHP/201607/168683.html a 函数 说明 abs 绝对值 acos 反余弦 acosh 反双曲余弦 addcsla ...

  8. 转:PHP – Best Practises

    原文来自于:http://thisinterestsme.com/php-best-practises/ There are a number of good practises that you s ...

  9. [源码]underscore-1.8.3

    // Underscore.js 1.8.3 // http://underscorejs.org // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud an ...

随机推荐

  1. 跟我一起读postgresql源码(一)——psql命令

    进公司以来做的都是postgresql相关的东西,每次都是测试.修改边边角角的东西,这样感觉只能留在表面,不能深入了解这个开源数据库的精髓,遂想着看看postgresql的源码,以加深对数据库的理解, ...

  2. FPGA基础学习(3) -- 跨时钟域处理方法

    文章主要是基于学习后的总结. 1. 时钟域 假如设计中所有的触发器都使用一个全局网络,比如FPGA的主时钟输入,那么我们说这个设计只有一个时钟域.假如设计有两个输入时钟,如图1所示,一个时钟给接口1使 ...

  3. 【算法笔记】B1036 跟奥巴马一起编程

    1036 跟奥巴马一起编程 (15 分) 美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统.2014 年底,为庆祝“计算机科学教育周”正式启动,奥巴 ...

  4. Luogu P1436 棋盘分割 暴力DP

    我的天,,,,,n=8,k<=15,,,这怕不是暴力DP+高维数组.... 开一个五维数组f[k][i][j][p][q]表示从(i,j)到(p,q)中分成k个矩形最小的平方和. 然后初始化时用 ...

  5. C# 有关系统音量的操作

    需要知道的 调音量是可以快捷键的,还可以用Winmm.dll,但是这个过于复杂了,还有左右声道,我们不需要这么复杂.还有个办法 https://stackoverflow.com/questions/ ...

  6. [转] SpringBoot RESTful 应用中的异常处理小结

    [From] https://segmentfault.com/a/1190000006749441 SpringBoot RESTful 应用中的异常处理小结 永顺 2016年08月29日发布 赞  ...

  7. JavaScript 精简笔记

    JavaScript 精简笔记,摘自 廖雪峰的官方网站. [From] https://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51 ...

  8. flask综合案例

    一.项目准备 1.新建项目目录students,并创建虚拟环境 mkvirtualenv students 2.安装依赖环境 pip install flask==0.12.4 pip install ...

  9. Form表单的几种提交方式

    <script type="text/javascript"> $(function() { //1.ajax提交 $("#ajaxBtn").cl ...

  10. groovy——运行方式、基本语法、引入方式、metaClass

    jvm运行groovy类有两种方式: 1.使用groovyc编译所有的*.groovy为java的*.class文件,把这些*.class文件放在java类路径中,通过java类加载器来加载这些类. ...