简体   繁体   中英

How can I get Sublime Text to search in files with control characters?

I have a bunch of log files containing outputs of a test suite, which often include control characters (most frequently ESC ). I need to search for a certain phrase in all the log files. Normally I'd use the CTRL + SHIFT + F function to do that but it seems that Sublime Text 2 fails to perform the said search on any file containing control characters (as also observed here ).

Is there anything I can do with setting Sublime up or is my only option writing a Python script purging the log files from control characters?

As indicated in the forum thread you linked, the best solution would be to upgrade to Sublime Text 3 or the latest ST3 dev build if you're a registered user. There are a huge number of bug fixes, improvements, and new features in ST3, and it has been quite stable for a long time (I've been using it exclusively for over 2 years now), even though it's still technically in "beta". In particular, the issue of searching files with control characters has been addressed. You'll need to follow the suggested workaround of reopening the file with UTF-8 encoding. You may also want to try adding

"default_encoding": "UTF-8",
"enable_hexadecimal_encoding": false,

to your user preferences to see if that gets around any of the issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM