Is there a way to highlight all special accent characters in sublime text or any other text editor?

I use special HTML characters in a special character in Sublime to convert all special characters to my HTML code. I have many accented characters in different parts of the file. So, it would be great if I could select all the special characters and then use the plugin to convert immediately!

Is there a regex that only selects all special characters?

+68
encoding html-encode sublimetext2 htmlspecialchars
Dec 20
source share
3 answers

Yes.

Sublime text supports regular expressions, and you can select all non-ASCII characters (code point> 128). This regular expression should be enough for you:

[^\x00-\x7F] 

Just find and replace.

But if you do manual HTML coding in the first place, you are doing it wrong. Save your files in UTF-8 encoding (Sublime Text 2 by default) and make sure your web server also sends these files as UTF-8. No conversion, encoding or anything else needed.

+161
Dec 21 '12 at 18:15
source share

As a sitelink (or as a complement):

A Sublime Text 2/3 package named Highlighter can (according to him) highlight some regex characters ...

"You can also add a custom regular expression to highlight characters."

So, with this package plus @Mikko Ohtamaa answer, we can edit the file ...

highlighter.sublime-settings - User

... and include the suggested regular expression (expressed here as [^\\x00-\\x7F] ) to get something like this:

 { "highlighter_regex": "(\t+ +)|( +\t+)|[^\\x00-\\x7F]|[\u2026\u2018\u2019\u201c\u201d\u2013\u2014]|[\t ]+$" } 

The result will be the automatic selection of any "non-ASCII (codewords> 128) characters" in our file.

Please note that this will not make a selection of these symbols, only highlight them to easily understand if you have any.

+13
Apr 30 '14 at 10:45
source share

Another plugin option

I recently wrote a plugin designed to highlight non-ascii characters: https://github.com/TuureKaunisto/highlight-dodgy-chars

Exactly the same functionality can be achieved with Highlighter, but with the less universal Highlight Dodgy Chars plugin you do not need to write regular expressions, you can simply list non-ascii characters that you do not want to highlight in the settings. European special characters are included in the whitelist by default.

+6
Dec 19 '15 at 21:49
source share



All Articles