From b47824fb63f35a6b9e9d858302c1db660d439322 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Wed, 23 Sep 2026 14:02:31 -0500 Subject: [PATCH] fix(core): recover reads with quote and accent variants (#50953) --- packages/core/src/tool/plugin/read.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/core/src/tool/plugin/read.ts b/packages/core/src/tool/plugin/read.ts index 1259dc81f8e..541889d8dcb 100644 --- a/packages/core/src/tool/plugin/read.ts +++ b/packages/core/src/tool/plugin/read.ts @@ -135,9 +135,14 @@ export const Plugin = { .pipe(Effect.orDie) const alternatePath = Effect.fn("ReadTool.alternatePath")(function* (absolute: string) { - const base = basename(absolute).replace(/[\u00a0\u202f]/g, " ") + const canonical = (name: string) => + name + .normalize("NFC") + .replace(/[\u00a0\u202f]/g, " ") + .replace(/[\u2018\u2019]/g, "'") + const base = canonical(basename(absolute)) const matches = (yield* reader.list(AbsolutePath.make(dirname(absolute)))).filter( - (entry) => entry.type === "file" && entry.name.replace(/[\u00a0\u202f]/g, " ") === base, + (entry) => entry.type === "file" && canonical(entry.name) === base, ) if (matches.length !== 1) return return join(dirname(absolute), matches[0].name)