当前位置:网站首页>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>
边栏推荐
- Quick analysis: easy to share the Internet
- 微信小程序使用towxml显示公式
- Wechat applet uses towxml to display formula
- 【apipost】使用教程
- 电脑怎么设置扬声器播放麦克风的声音
- Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
- Stm32-dac Experiment & high frequency DAC output test
- Daily learning 2
- NLA natural language analysis makes data analysis more intelligent
- 1. Editing weapon VIM
猜你喜欢

Stm32-dac Experiment & high frequency DAC output test

Socket and socket address

没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法

obsidian安装第三方插件——无法加载插件

fatal: unsafe repository is owned by someone else 的解决方法

mathML转latex

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

buuctf-pwn write-ups (7)

What is erdma? Popular science cartoon illustration

Development and design of animation surrounding mall sales website based on php+mysql
随机推荐
##51单片机实验之简易验证码发生器
Advanced usage of C language -- function pointer: callback function; Conversion table
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
Fabric.js 动态设置字号大小
[QNX Hypervisor 2.2用户手册]6.3 Guest与外部之间通信
Implement a server with multi process concurrency
1、编辑利器vim
Fabric.js 自由绘制圆形
字符串匹配问题
Fabric. JS zoom canvas
Fabric.js 缩放画布
1. Editing weapon VIM
Tujia muniao meituan has a discount match in summer. Will it be fragrant if the threshold is low?
String matching problem
【apipost】使用教程
Talk about idempotent design
STM32标准固件库函数名(一)
【空间&单细胞组学】第1期:单细胞结合空间转录组研究PDAC肿瘤微环境
The use of TestNG, the testing framework (II): the use of TestNG XML
What is erdma? Popular science cartoon illustration