当前位置:网站首页>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>
边栏推荐
- Fatal: unsafe repository is owned by someone else
- 3、函数指针和指针函数
- It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
- Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
- 删除元素(带过渡动画)
- C语言高级用法--函数指针:回调函数;转换表
- Development and design of animation surrounding mall sales website based on php+mysql
- 2. Const pointer
- 电脑怎么设置扬声器播放麦克风的声音
- obsidian安装第三方插件——无法加载插件
猜你喜欢

Add vector formula in rich text editor (MathType for TinyMCE, visual addition)

buuctf-pwn write-ups (7)

JMeter script parameterization
[email protected]: The platform “win32“ is incompatible with this module."/>info [email protected]: The platform “win32“ is incompatible with this module.

Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly

一张图彻底掌握prototype、__proto__、constructor之前的关系(JS原型、原型链)

Advanced C language (learn malloc & calloc & realloc & free in simple dynamic memory management)

微信小程序使用towxml显示公式

HMS core machine learning service helps zaful users to shop conveniently

Tujia muniao meituan has a discount match in summer. Will it be fragrant if the threshold is low?
随机推荐
NLA natural language analysis makes data analysis more intelligent
freemarker的使用
YoloV6训练:训练自己数据集遇到的各种问题
< schéma de développement de la machine d'exercice oral > machine d'exercice oral / trésor d'exercice oral / trésor de mathématiques pour enfants / lecteur LCD de calculatrice pour enfants IC - vk1621
由粒子加速器产生的反中子形成的白洞
Fabric. JS zoom canvas
使用mathtype编辑公式,复制粘贴时设置成仅包含mathjax语法的公式
Bit by bit of OpenCV calling USB camera
Implement a server with multi process concurrency
taobao. trade. Get (get some information of a single transaction), Taobao store order interface, Taobao oauth2.0 interface, Taobao R2 interface code docking and sharing
buuctf-pwn write-ups (7)
jmeter脚本参数化
Fundamentals of software testing
【apipost】使用教程
obsidian安装第三方插件——无法加载插件
Daily learning 3
《可供方案开发》口算训练机/数学宝/儿童口算宝/智能数学宝 LCD液晶显示驱动IC-VK1622(LQFP64封装),原厂技术支持
Daily learning 2
taobao.trade.get( 获取单笔交易的部分信息),淘宝店铺订单接口,淘宝oAuth2.0接口,淘宝R2接口代码对接分享
Quick analysis: easy to share the Internet