check utf8

This commit is contained in:
Pham Tu 2024-01-18 11:21:07 +07:00
parent 312726b384
commit 0c3ec3faa1
No known key found for this signature in database
GPG Key ID: 7460FD99133ADA1C

View File

@ -12,7 +12,11 @@ const text = computed(() => {
case 'base64':
return toBase64(props.value);
default:
return fromAscii(props.value);
try {
return fromAscii(props.value);
} catch {
return 'Invalid Utf8';
}
}
});
function change(value: string) {