{"record":{"id":"979cd8ee29621aa5","repo":"zed-industries/zed","slug":"binary-files-are-not-supported-979cd8","errorCode":null,"errorMessage":"Binary files are not supported","messagePattern":"Binary files are not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/language/src/buffer.rs","lineNumber":1631,"sourceCode":"        if modeline.as_ref() != self.modeline.as_deref() {\n            self.modeline = modeline.map(Arc::new);\n            self.refresh_resolved_settings(cx);\n            true\n        } else {\n            false\n        }\n    }\n\n    /// Returns the [`ModelineSettings`].\n    pub fn modeline(&self) -> Option<&Arc<ModelineSettings>> {\n        self.modeline.as_ref()\n    }\n\n    /// Assign the buffer a new [`Capability`].\n    pub fn set_capability(&mut self, capability: Capability, cx: &mut Context<Self>) {\n        if self.capability != capability {\n            self.capability = capability;\n            cx.emit(BufferEvent::CapabilityChanged)\n        }\n    }\n\n    /// This method is called to signal that the buffer has been saved.\n    pub fn did_save(\n        &mut self,\n        version: clock::Global,\n        mtime: Option<MTime>,\n        cx: &mut Context<Self>,\n    ) {\n        self.saved_version = version.clone();\n        self.has_unsaved_edits.set((version, false));\n        self.has_conflict = false;\n        self.saved_mtime = mtime;\n        self.was_changed();\n        cx.emit(BufferEvent::Saved);\n        cx.notify();\n    }","sourceCodeStart":1613,"sourceCodeEnd":1649,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/language/src/buffer.rs#L1613-L1649","documentation":"Guard in the buffer's reload_impl: after loading the file's bytes from disk, analyze_byte_content classified the content as ByteContent::Binary, so it cannot be decoded as text into the buffer. Zed refuses to load binary files as editable text buffers; this fires on reload/reopen of a file that is (or has become) binary, such as images, archives, or executables.","triggerScenarios":"Thrown at crates/language/src/buffer.rs:1616 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the file with an appropriate binary viewer or external tool instead of the text editor","If the file should be text, check for corruption or a wrong extension/encoding","Force the correct encoding with reload_with_encoding if the file is text in a non-Unicode encoding"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}