diff --git a/src/components/repository/file-browser.tsx b/src/components/repository/file-browser.tsx index 8ba6ce8..fac4de1 100644 --- a/src/components/repository/file-browser.tsx +++ b/src/components/repository/file-browser.tsx @@ -115,9 +115,11 @@ export const FileBrowser = ({ branch, initialPath = "" }: FileBrowserProps) => { }); const data = resp.data?.data; if (!data) return null; - // Content is base64 encoded + // Content is base64 encoded, use TextDecoder for proper UTF-8 handling try { - return atob(data.content); + const binary = atob(data.content); + const bytes = Uint8Array.from(binary, c => c.charCodeAt(0)); + return new TextDecoder("utf-8", { fatal: false }).decode(bytes); } catch { return data.content; }