mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
13 lines
246 B
Go
13 lines
246 B
Go
|
package files
|
||
|
|
||
|
func isBinary(content string) bool {
|
||
|
for _, b := range content {
|
||
|
// 65533 is the unknown char
|
||
|
// 8 and below are control chars (e.g. backspace, null, eof, etc)
|
||
|
if b <= 8 || b == 65533 {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|