Strip Special Characters From Text: What Gets Removed and What Stays
There is no single definition of a special character. Here is exactly what one popular cleanup button keeps, what it deletes, and a short check to run before you click.
"Remove special characters" is one of the most common text cleanup jobs, and nobody agrees on what counts as special. To one person it means emoji and stray symbols. To another it includes the curly apostrophe in it's. A cleanup button has to pick a rule, and the rule decides what you lose. This post tests the rule behind the Strip Special Chars button in ClearText Editor, so you can see what survives before you use it on anything important.
Want to try the examples yourself? ClearText Editor has the button, and it runs in your browser with nothing uploaded.
How the Rule Works
The button does not hunt for a list of bad characters. It keeps a list of good ones and deletes everything else. The kept list is: the letters A to Z, accented Latin letters in the range from À to ɏ, digits, any whitespace, and these punctuation marks: . , ! ? ; : ' " ( ) [ ] { } - – — @ # % & * + = < > ~ ^ _ | ` / \. Anything outside that list is removed, and nothing is replaced with a space.
Pasted text is inserted unchanged. The rule only runs when you click the button, and the tests below show what it removes.
Test Results
I ran each input through the same pattern the button uses.
| Input | Result | What happened |
|---|---|---|
| café, Zoë, Straße | unchanged | Accented Latin letters are on the kept list. |
| šđčćž | unchanged | Serbian, Polish and Turkish letters are inside the range too. |
| Việt Nam | Vit Nam | Vietnamese letters with stacked marks sit outside the range, so the letter itself is deleted. |
| Привет | nothing left | Cyrillic letters are not on the list. |
| 你好 | nothing left | Chinese characters are not on the list either. |
| it’s | its | The curly apostrophe is not the straight one, so it is deleted. |
| “quoted” | quoted | Curly double quotes are deleted. Straight quotes stay. |
| $100, €50 | 100, 50 | Currency symbols are deleted, so the price loses its unit. |
| wait… | wait | The single ellipsis character is deleted. Three full stops stay. |
| 😀 hi | hi, with a leading space | Emoji are deleted, but the space after them stays. |
| em—dash, en–dash | unchanged | Both dashes are on the list. |
The result that matters most is the quietest: it’s becomes its. Word processors and phone keyboards type the curly apostrophe by default, so text copied from them can lose its apostrophes and change meaning without any visible error.
There are two more cases worth knowing. A letter written as a base letter plus a separate accent mark loses the accent, so a decomposed café comes out as cafe. And invisible characters such as the zero-width space are removed, which is useful if you are cleaning text that contains them. For where those come from, see The Invisible Characters Hiding in Text You Copy and Paste.
A Check Before You Click
- Look for non-Latin scripts. Cyrillic, Greek, Arabic and CJK text will be deleted entirely.
- Look for prices, quotes and apostrophes. Replace curly quotes and apostrophes with straight ones first if you want to keep them.
- Check Vietnamese and other stacked-mark text. Letters outside the accented range disappear.
- Keep the original. The button changes the text in place, so hold on to the source text until you have read the result.
The Two Neighbouring Buttons
The Text Purifier group has two more cleanups, and they also do more than their names suggest. Remove Double Spaces turns any run of two or more ordinary spaces into one, including indentation at the start of a line, and leaves tabs and non-breaking spaces alone; see Why Removing Double Spaces Matters Before You Send. Remove Empty Lines removes every blank line and trims the ends of the text, so paragraph gaps disappear along with accidental ones; see How to Remove All Blank Lines From Text Instantly.
The honest summary: Strip Special Chars keeps a short list of characters and deletes the rest. It is safe for plain English with accented Latin letters, and risky for curly apostrophes, currency symbols, emoji and anything outside Latin script. Read the result before you replace the original.
For questions or inquiries contact us at info@cleartexteditor.com