mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-21 22:58:24 +00:00
fix foreign chars
This commit is contained in:
parent
c72e00f784
commit
ed59684ac9
@ -129,13 +129,13 @@ async function openGrasscutterFolder() {
|
||||
|
||||
// https://www.jimzhao.us/2015/09/javascript-detect-chinese-character.html
|
||||
function hasForeignChars(str) {
|
||||
let re1 = /^[A-Za-z\d,.?;:\\/'"!$%() ]*/g
|
||||
let re1 = /[^a-z0-9_.,-\\/: ]/g
|
||||
str = str.replace(/\s/g, '')
|
||||
|
||||
debug.log('Checking for foreign chars in path: ', str)
|
||||
debug.log('Path includes foreign chars? ', re1.test(str))
|
||||
|
||||
return !re1.test(str)
|
||||
return re1.test(str)
|
||||
}
|
||||
|
||||
function openDialog(title, message, negBtn = false, affirmBtn = closeDialog) {
|
||||
|
Loading…
Reference in New Issue
Block a user