当前位置:网站首页>Some Chinese character codes in the user privacy agreement are not standardized, which leads to the display of garbled codes on the web page. It needs to be found and handled uniformly
Some Chinese character codes in the user privacy agreement are not standardized, which leads to the display of garbled codes on the web page. It needs to be found and handled uniformly
2022-07-02 14:48:00 【Xu Tongbao】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title> Process the agreement file </title>
<style>
.m-source {
font-size: 30px;
color: #f66f0c;
}
.m-reslut {
font-size: 30px;
color: green;
}
.m-text {
white-space: pre-wrap;
width: 100%;
}
</style>
</head>
<body>
<div>
<div class="m-source"> Source protocol :</div>
<!-- Copy the text of the agreement document on the flybook to the following div in -->
<div id="source" class="m-text">
One 、 individual ⼈ Information definition and scope
(⼀) individual ⼈ Information : Refers to electricity ⼦ Or other ⽅ Capable of being recorded independently or in combination with other information , Identify specific ⾃ however ⼈ Identity or reflect specific ⾃ however ⼈ Information about activities .
(⼆) individual ⼈ Sensitive information : Including ID number 、⼿ Machine number 、 individual ⼈⽣ Object identification information 、 silver ⾏ account number 、 Property information 、⾏ Track 、 Transaction information 、 Under 14 ( contain )⼉ Tong's one ⼈ Information, etc .
( 3、 ... and ) There are... Involved in this privacy policy ⼈ Information and ⼈ Sensitive information mainly includes :
1. Basic information of users : full name 、 Gender 、 individual ⼈ Phone number 、 Mailing address 、 grade 、 School, etc ;
2. ⽹ Network identity information : System account number ( Including the third ⽅)、IP Address / The type of browser 、 Telecom operators and passwords related to the foregoing 、 nickname 、 Head etc. ;
3. BesTV Cloud lesson makes ⽤ data : Browsing and clicking records 、 Software make ⽤ Record 、 adopt ⻨ g ⻛ transport ⼊ And so on ;
4. individual ⼈ often ⽤ Equipment information : Model of equipment 、 Operating system version 、 devices setting up 、 Unique device identifier and other software and hardware characteristic information ;
5. individual ⼈ Location information : Such as through GPS、 Bluetooth or WiFi Position information obtained by signal, etc ;
6. send ⽤ Third ⽅ Service production ⽣ The capital of ⾦ flow ⽔ Record .
</div>
<div class="m-reslut"> add to 【】 Find out the garbled words :</div>
<div id="result" class="m-text"></div>
<div class="m-reslut"> The garbled code has been eliminated :</div>
<div id="well-result" class="m-text"></div>
</div>
<script>
//const source = `01abA Use B people `
//const source = `“BesTV Cloud class ”`
const source = document.getElementById('source').innerHTML
const findBug = (value) => {
const start = 0x4e00
const end = 0x9fa5
let result = []
let count = 0
let leftArr = []
;[...value].forEach((item) => {
const current = item.charCodeAt()
//console.log(item, current)
if (
0x2000 <= current &&
current <= 0x2fff &&
current !== 8220 &&
current != 8221
) {
result.push(`【${item}】`)
count++
leftArr.push(item)
} else {
result.push(item)
}
})
return { result, count, leftArr }
}
const step1 = () => {
let { result, count, leftArr } = findBug(source)
const resultStr = result.join('')
document.getElementById('result').innerHTML = resultStr
console.log('##### First step #####')
console.log(' The number of garbled words ,:', count)
const unique = [...new Set(leftArr)]
console.log(' Garbled word array ( After weight removal )', unique.length, unique)
}
// Fill in the text that needs to be replaced , Regular expressions are garbled words
const doReplace = () => {
// '⽅', '⼀', '⼆', '⼦', '⼿', '⽣', '⾏', '⼉', '⽹', '⻨',
// '⻛', '⼊', '⾦', '⽔', '⽬', '⽌', '⼯', '⻚', '⾯', '⽀',
// '⽚', '⾥', '⼝', '⼤', '⼜', '⽆', '⼩', '⾼', '⻔', '⽽',
// '⾔', '⼒', '⼰', '⾜', '⾮', '⻓', '⽴', '⽇'
// '⼈', '⾃', '⽤', '⻅', '⽂'
let wellResult = source
.replace(/⽅/g, ' Fang ')
.replace(/⼀/g, ' One ')
.replace(/⼆/g, ' Two ')
.replace(/⼦/g, ' Son ')
.replace(/⼿/g, ' hand ')
.replace(/⽣/g, ' raw ')
.replace(/⾏/g, ' That's ok ')
.replace(/⼉/g, ' son ')
.replace(/⽹/g, ' network ')
.replace(/⻨/g, ' wheat ')
.replace(/⻛/g, ' wind ')
.replace(/⼊/g, ' Enter into ')
.replace(/⾦/g, ' gold ')
.replace(/⽔/g, ' water ')
.replace(/⽬/g, ' Objective ')
.replace(/⽌/g, ' stop ')
.replace(/⼯/g, ' work ')
.replace(/⻚/g, ' page ')
.replace(/⾯/g, ' Noodles ')
.replace(/⽀/g, ' the ')
.replace(/⽚/g, ' slice ')
.replace(/⾥/g, ' in ')
.replace(/⼝/g, ' mouth ')
.replace(/⼤/g, ' Big ')
.replace(/⼜/g, ' also ')
.replace(/⽆/g, ' nothing ')
.replace(/⼩/g, ' Small ')
.replace(/⾼/g, ' high ')
.replace(/⻔/g, ' door ')
.replace(/⽽/g, ' and ')
.replace(/⾔/g, ' said ')
.replace(/⼒/g, ' force ')
.replace(/⼰/g, ' Oneself ')
.replace(/⾜/g, ' foot ')
.replace(/⾮/g, ' Not ')
.replace(/⻓/g, ' Long ')
.replace(/⽴/g, ' state ')
.replace(/⽇/g, ' Japan ')
.replace(/⼈/g, ' people ')
.replace(/⾃/g, ' since ')
.replace(/⽤/g, ' use ')
.replace(/⻅/g, ' see ')
.replace(/⽂/g, ' writing ')
return wellResult
}
const step2 = () => {
let { result, count, leftArr } = findBug(doReplace(source))
const resultStr = result.join('')
document.getElementById('well-result').innerHTML = resultStr
console.log('##### The second step #####')
console.log(' The number of garbled words :', count, leftArr)
const wellUnique = [...new Set(leftArr)]
console.log(' Garbled word array ( After weight removal )', wellUnique.length, wellUnique)
}
const init = () => {
// The first step is to find out the garbled words
step1()
// Replace garbled text
step2()
}
init()
</script>
</body>
</html>
边栏推荐
- buuctf-pwn write-ups (7)
- Fabric. JS manual bold text iText
- STM32库函数进行GPIO初始化
- Yolov3 & yolov5 output result description
- How many knowledge points can a callable interface have?
- C语言高级用法--函数指针:回调函数;转换表
- Certik released the defi security report in 2021, disclosing key data of industry development (PDF download link attached)
- PHP linked list creation and traversal
- Fabric.js 动态设置字号大小
- 使用mathtype编辑公式,复制粘贴时设置成仅包含mathjax语法的公式
猜你喜欢
富文本编辑器添加矢量公式(MathType for TinyMCE ,可视化添加)
Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
kityformula-editor 配置字号和间距
MQ tutorial | exchange (switch)
一张图彻底掌握prototype、__proto__、constructor之前的关系(JS原型、原型链)
fatal: unsafe repository is owned by someone else 的解决方法
mathjax 入门(web显示数学公式,矢量的)
大顶堆、小顶堆与堆排序
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
YoloV6训练:训练自己数据集遇到的各种问题
随机推荐
tmall.product.schema.get( 产品信息获取schema获取 ),淘宝店铺上传商品API接口,淘宝商品发布接口,淘宝商品上传API接口,店铺上传接口,oAuth2.0接口
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
Fabric.js 上划线、中划线(删除线)、下划线
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
Fabric.js 橡皮擦的用法(包含恢复功能)
Fatal: unsafe repository is owned by someone else
Fabric. JS zoom canvas
taobao. trades. sold. Get query the transaction data that the seller has sold (according to the creation time), Taobao store sales order query API interface, Taobao R2 interface, Taobao oauth2.0 trans
广州市应急管理局发布7月高温高湿化工安全提醒
Simple verification code generator for 51 single chip microcomputer experiment
什么是 eRDMA?丨科普漫画图解
Chinese science and technology from the Winter Olympics (III): the awakening and evolution of digital people
4、数组指针和指针数组
由粒子加速器产生的反中子形成的白洞
Fabric. JS free drawing ellipse
YoloV6训练:训练自己数据集遇到的各种问题
Use of freemaker
Available solution development oral arithmetic training machine / math treasure / children's oral arithmetic treasure / intelligent math treasure LCD LCD driver ic-vk1622 (lqfp64 package), original te
微信小程序使用towxml显示公式
taobao.logistics.dummy.send( 无需物流发货处理 )接口,淘宝店铺发货API接口,淘宝订单发货接口,淘宝r2接口,淘宝oAu2.0接口