SteGriff

Blog

Next & Previous

Notepad++, file encodings, and NBSPs

Usually if there’s a non-breaking space (or NBSP, unicode char 0x00A0) in a file, and you switch on “Show all Characters” in Notepad++, the NBSP will show as a nice, legible black square.

However, if you load a file that has an ANSI encoding, it will show as a completely white glyph. This is different to a regular space, which shows a tiny orange dot between words.

A file in Notepad++. Some words have an orange dot between them, whereas some have a totally white gap, which is a non-breaking space. The status bar shows an encoding of "ANSI".

How to make the NBSPs appear

You can make the NBSP show up in an ANSI file by selecting the Character Set that’s in use, from the Encoding | Character sets menu. Usually on an “English” computer, this will be Encoding | Character sets | Western European | Windows-1252. This info isn’t saved with the file, so you’ll have to reselect it after each load.

The same file from before is displayed in Notepad++. Now the non-breaking spaces show as blacked out glyphs reading "NBSP". The status bar shows an encoding of "Windows-1252".

Or, instead, you could convert the file to UTF-8. On the encoding menu, click “Convert to UTF-8” and then save the file.

Bye bye now 💽🧑‍🚀