Skip to content

Commit 2879785

Browse files
authored
chore(devtool): add compatibility for UTF character (#4265)
1 parent 220bbe3 commit 2879785

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vee-validate/src/devtools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ function encodeNodeId(form?: PrivateFormContext, stateOrField?: PathState | Priv
356356
const fieldPath = stateOrField ? ('path' in stateOrField ? stateOrField?.path : unref(stateOrField?.name)) : '';
357357
const idObject = { f: form?.formId, ff: fieldPath, type };
358358

359-
return btoa(JSON.stringify(idObject));
359+
return btoa(encodeURIComponent(JSON.stringify(idObject)));
360360
}
361361

362362
function decodeNodeId(nodeId: string): {
@@ -366,7 +366,7 @@ function decodeNodeId(nodeId: string): {
366366
type?: 'form' | 'field' | 'pathState';
367367
} {
368368
try {
369-
const idObject = JSON.parse(atob(nodeId));
369+
const idObject = JSON.parse(decodeURIComponent(atob(nodeId)));
370370
const form = DEVTOOLS_FORMS[idObject.f];
371371

372372
if (!form && idObject.ff) {

0 commit comments

Comments
 (0)