Skip to content

Commit 841dae0

Browse files
committed
gptel: Improve binary file detection with multibyte check
* gptel.el (gptel--file-binary-p): Detect multibyte coding-systems used for binary files in `gptel--file-binary-p'. Should help with problems like #914 and possibly #912.
1 parent e0018f5 commit 841dae0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gptel.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,8 @@ Later plists in the sequence take precedence over earlier ones."
976976
(condition-case nil
977977
(with-temp-buffer
978978
(insert-file-contents path nil 1 512 'replace)
979-
(eq buffer-file-coding-system 'no-conversion))
979+
(memq buffer-file-coding-system
980+
'(no-conversion no-conversion-multibyte)))
980981
(file-missing (message "File \"%s\" is not readable." path)
981982
nil)))
982983

0 commit comments

Comments
 (0)