Sublime Forum

Sublime Text thinks text file is binary

#1

I did a search on all files in my project and this is the result:

[code]Searching 368 files for “myString”

–some search results appear here–

REDACTED/file_foo.js:

3 matches across 3 files[/code]

file_foo.js opens just fine in Sublime Text and other editors and you can edit it fine too. Why does it show up as binary? How can I troubleshoot this?

0 Likes

ST3 conduct search within 'find result'
#2

In general, if a file contains any ASCII characters < 32, except 0x3, 0x9, 0xa, 0xc or 0xd, then it’s considered binary

0 Likes

#3

That fails if you have any embedded characters in source code.

I think that this character check should be the fallback if there is no file extension, or if the file extension is ambiguous.

0 Likes

#4

so stupid for that

0 Likes

#5

actually, it’s not sure that you said. If the file size is small no matter there are 0x3, 0x9, 0xa, 0xc or 0xd. search work well.

if the file size large, may be it consider to binary

0 Likes

#6

I could not get it to work in Sublime so I switched to Visual Studio Code to solve my problem.

0 Likes

#7

I’m trying out ST3 build 3126. I have a text file (file.txt) which contains few lines with non-readable characters, otherwise the file is fully ASCII. When I try to look for some string using “File in files” (Ctrl+Shift+F) in this file the results show count of occurrences but doesn’t show any lines, rather it just says “”. I agree there are some binary characters in the file but it doesn’t qualify for it to treat whole file as binary & not to show any lines containing strings. Is there a tweak/option I can set to override this behaviour. click on https://www.applesupportphonenumbers.com/service-support/apple-tv-support/ for more detail

0 Likes

#8

2022 here this issue is still not fixed… We should at least recommend a solution as for how to make the search work again on those files

0 Likes