当前位置:网站首页>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>
边栏推荐
- 卷积神经网络(入门)
- 【题解】Educational Codeforces Round 82
- Yyds dry goods inventory software encryption lock function
- taobao.trades.sold.get-查询卖家已卖出的交易数据(根据创建时间),淘宝店铺卖出订单查询API接口,淘宝R2接口,淘宝oAuth2.0交易接口代码分享
- STM32库函数进行GPIO初始化
- 提示:SQL Server 阻止了对组件‘Ad Hoc Distributed Queries ‘的STATEMENT ‘OpenRowset/OpenDatasource“”
- Fabric. JS dynamically set font size
- Socket and socket address
- 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
- C#代码审计实战+前置知识
猜你喜欢

Chinese science and technology from the Winter Olympics (III): the awakening and evolution of digital people

Fabric.js 自由绘制圆形
![[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)](/img/08/9f25515e600a3174340b2589c81b0e.jpg)
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)

Fabric. Usage of JS eraser (including recovery function)

YoloV6训练:训练自己数据集遇到的各种问题

测试框架TestNG的使用(二):testNG xml的使用

Pychart connects to the remote server

Xilinx Vivado set *.svh as SystemVerilog Header

Wechat applet uses towxml to display formula

【apipost】使用教程
随机推荐
Fabric.js 自由绘制椭圆
The evolution process of the correct implementation principle of redis distributed lock and the summary of redison's actual combat
JMeter script parameterization
4. Array pointer and pointer array
mathML转latex
没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法
Fabric. JS zoom canvas
STM32库函数进行GPIO初始化
Xilinx Vivado set *. svh as SystemVerilog Header
socket(套接字)与socket地址
ONNX+TensorRT:将预处理操作写入ONNX并完成TRT部署
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
Fabric. JS upper dash, middle dash (strikethrough), underline
docker mysql
大顶堆、小顶堆与堆排序
taobao. logistics. dummy. Send (no logistics delivery processing) interface, Taobao store delivery API interface, Taobao order delivery interface, Taobao R2 interface, Taobao oau2.0 interface
Development and design of animation surrounding mall sales website based on php+mysql
[Space & single cellomics] phase 1: single cell binding space transcriptome research PDAC tumor microenvironment
Understanding of mongodb
STM32-DAC实验&高频DAC输出测试