Introduction

Notepad++ is using Scintilla for the editor component. Scintilla has a function SCI_SETCONTROLCHARSYMBOL(int symbol) where you can set the character that will be used for the control characters. From the Scintilla Docs they describe the functionality:

SCI_SETCONTROLCHARSYMBOL(int symbol)

SCI_GETCONTROLCHARSYMBOL

By default, Scintilla displays control characters (characters with codes less than 32) in a rounded rectangle as ASCII mnemonics: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US". These mnemonics come from the early days of signaling, though some are still used (LF = Line Feed, BS = Back Space, CR = Carriage Return, for example).

You can choose to replace these mnemonics by a nominated symbol with an ASCII code in the range 32 to 255. If you set a symbol value less than 32, all control characters are displayed as mnemonics. The symbol you set is rendered in the font of the style set for the character. You can read back the current symbol with the SCI_GETCONTROLCHARSYMBOL message. The default symbol value is 0.

There's probably a "right" way to do this, but I'm going to give you a very hack-y way of accomplishing this.

Technique

Edit the file %APPDATA%\Notepad++\shortcuts.xml using anything EXCEPT Notepad++.

Add the following to the <Macros> section of the file to manually add a macro:

<Macro name="RemoveControl" Ctrl="no" Alt="no" Shift="no" Key="0">
        <Action type="0" message="2388" wParam="32" lParam="0" sParam="" />
</Macro>

Note that you can set a shortcut with the Ctrl, Alt, Shift and Key attributes. The wParam will set the character which will be used instead of the spelled-out codes. In this case, code 32 is a Space in the ASCII standard. Message 2388 is the constant for the SCI_SETCONTROLCHARSYMBOL value.

Save the file

Use

Now you can change the behavior of Notepad++ at runtime. To use this do the following

Open Notepad++ Simply open the editor. If you open a file directly (ie. Edit with Notepad++ context menu) you will get weird behavior.

Activate the macro from the menu (or your shortcut). If there's a way to automate running a macro on startup it would be nice to add it here

Open your file. Nothing new here

Notes

  1. The positions with the control character will still be inverted (white text on black background by default).
  2. If you activate the macro when you have a document open it will not take effect right away. You'll have to do something to force the window to redraw.
  3. A look at the Scintilla.h file may open up other options which could be similarly exploited.
Answer from anon on Stack Overflow
🌐
Notepad++ Community
community.notepad-plus-plus.org › topic › 26440 › how-to-remove-this-symbols-from-txt-file
How to remove this symbols from txt file | Notepad++ Community
December 19, 2024 - mohammad-Al-Maaitah if your first and last symbol is you can type \x16.*?\x16 in the Find field, tick the regular expression mode, leave the Replace field empty and click Replace in files (to remove it from multiple files).
🌐
Eileen's Lounge
eileenslounge.com › viewtopic.php
Remove SOH special character - Eileen's Lounge
May 5, 2022 - Please have a look at the variables in local window. ... I do see that the active cell is not being filled, but what does that have to do with SOH?
🌐
Notepad++ Community
community.notepad-plus-plus.org › topic › 11233 › disable-ascii-control-characters-shortcuts
Disable ASCII Control characters shortcuts? | Notepad++ Community
February 4, 2024 - <Macro name="RemoveKey_Shift_Esc_ESC" Ctrl="no" Alt="no" Shift="yes" Key="27"> <Action type="0" message="0" wParam="0" lParam="0" sParam="" /> </Macro> <Macro name="RemoveKey_Ctrl_E_ENQ" Ctrl="yes" Alt="no" Shift="no" Key="69"> <Action type="0" message="0" wParam="0" lParam="0" sParam="" /> </Macro> <Macro name="RemoveKey_Ctrl_R_DC2" Ctrl="yes" Alt="no" Shift="no" Key="82"> <Action type="0" message="0" wParam="0" lParam="0" sParam="" /> </Macro> <Macro name="RemoveKey_Ctrl_Shift_-_US" Ctrl="yes" Alt="no" Shift="yes" Key="189"> <Action type="0" message="0" wParam="0" lParam="0" sParam="" /> </M
Top answer
1 of 2
19

Introduction

Notepad++ is using Scintilla for the editor component. Scintilla has a function SCI_SETCONTROLCHARSYMBOL(int symbol) where you can set the character that will be used for the control characters. From the Scintilla Docs they describe the functionality:

SCI_SETCONTROLCHARSYMBOL(int symbol)

SCI_GETCONTROLCHARSYMBOL

By default, Scintilla displays control characters (characters with codes less than 32) in a rounded rectangle as ASCII mnemonics: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US". These mnemonics come from the early days of signaling, though some are still used (LF = Line Feed, BS = Back Space, CR = Carriage Return, for example).

You can choose to replace these mnemonics by a nominated symbol with an ASCII code in the range 32 to 255. If you set a symbol value less than 32, all control characters are displayed as mnemonics. The symbol you set is rendered in the font of the style set for the character. You can read back the current symbol with the SCI_GETCONTROLCHARSYMBOL message. The default symbol value is 0.

There's probably a "right" way to do this, but I'm going to give you a very hack-y way of accomplishing this.

Technique

Edit the file %APPDATA%\Notepad++\shortcuts.xml using anything EXCEPT Notepad++.

Add the following to the <Macros> section of the file to manually add a macro:

<Macro name="RemoveControl" Ctrl="no" Alt="no" Shift="no" Key="0">
        <Action type="0" message="2388" wParam="32" lParam="0" sParam="" />
</Macro>

Note that you can set a shortcut with the Ctrl, Alt, Shift and Key attributes. The wParam will set the character which will be used instead of the spelled-out codes. In this case, code 32 is a Space in the ASCII standard. Message 2388 is the constant for the SCI_SETCONTROLCHARSYMBOL value.

Save the file

Use

Now you can change the behavior of Notepad++ at runtime. To use this do the following

Open Notepad++ Simply open the editor. If you open a file directly (ie. Edit with Notepad++ context menu) you will get weird behavior.

Activate the macro from the menu (or your shortcut). If there's a way to automate running a macro on startup it would be nice to add it here

Open your file. Nothing new here

Notes

  1. The positions with the control character will still be inverted (white text on black background by default).
  2. If you activate the macro when you have a document open it will not take effect right away. You'll have to do something to force the window to redraw.
  3. A look at the Scintilla.h file may open up other options which could be similarly exploited.
2 of 2
0

If you want to avoid these character in the future select Session Logging feature, as such in Putty, Log "printable output" only. This will take out all the unnecessary Scintilla characters.

Regarding Putty (cached link below):

4.2 The Logging panel

The Logging configuration panel allows you to save log files of your PuTTY sessions, for debugging, analysis or future reference.

The main option is a radio-button set that specifies whether PuTTY will log anything at all. The options are

+"Logging turned off completely". This is the default option; in this mode PuTTY will not create a log file at all.

+"Log printable output only". In this mode, a log file will be created and written to, but only printable text will be saved into it. The various terminal control codes that are typically sent down an interactive session alongside the printable text will be omitted. This might be a useful mode if you want to read a log file in a text editor and hope to be able to make sense of it.

+"Log all session output". In this mode, everything sent by the server into your terminal session is logged. If you view the log file in a text editor, therefore, you may well find it full of strange control characters. This is a particularly useful mode if you are experiencing problems with PuTTY's terminal handling: you can record everything that went to the terminal, so that someone else can replay the session later in slow motion and watch to see what went wrong.

+"Log SSH packet data". In this mode (which is only used by SSH connections), the SSH message packets sent over the encrypted connection are written to the log file. You might need this to debug a network-level problem, or more likely to send to the PuTTY authors as part of a bug report. BE WARNED that if you log in using a password, the password will appear in the log file, so be sure to edit it out before sending the log file to anyone else!

LINK: http://webcache.googleusercontent.com/search?q=cache:L0M6HnWRvowJ:the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter4.html+&cd=1&hl=en&ct=clnk&gl=us

🌐
Whatismarkdown
whatismarkdown.com › how-to-remove-the-sohl-character-from-a-text-file-using-notepad
December 15, 2022 - We cannot provide a description for this page right now
🌐
Notepad++ Community
community.notepad-plus-plus.org › topic › 25179 › special-characters-with-unmapped-shortcut-combos
Special characters with unmapped "shortcut" combos | Notepad++ Community
April 11, 2024 - Only users with topic management privileges can see it. ... Take a fresh portable Notepad++ 8.6 64-bit (older is fine, this is not a new behavior) and open it. ... I pressed the key-combo 3 times. ... anything at all, it really doesn’t matter … subsequent SHIFT+CTRL+A will no longer insert the SOH character but will perform the shortcut (as expected).
🌐
Blogger
metadataconsulting.blogspot.com › 2019 › 06 › Notepad-Control-Characters-Explained.html
Metadata Consulting [dot] ca - Award Winning Software Blog: Notepad++ Control Characters Explained NUL, SOH, STX, etc
June 12, 2019 - See see Settings → Preferences → Language → Replace by Space 4. Match displayed control character in Notepad++ to the acronym column in tables below. Notepad++ indicated control characters with white lettering on a black background such as SOH, STX, ETX, EOT, BS, etc, which you can easily ...
Find elsewhere
🌐
Notepad++ Community
community.notepad-plus-plus.org › topic › 21842 › how-to-not-show-stx-code-on-text-page
How to NOT show STX code on text page ? | Notepad++ Community
September 18, 2021 - If the file intentionally contains that or other binary/control characters, Notepad++ is the wrong tool to be looking at your file – you might accidentally corrupt the file, and make it unusable for its intended purpose.
🌐
Notepad++ Community
community.notepad-plus-plus.org › topic › 25498 › notepad-enters-unwanted-invisible-ascii-0-31-characters
Notepad++ enters unwanted invisible (ASCII 0–31) characters | Notepad++ Community
March 24, 2024 - Code | Name ----------- 00 | NUL 01 | SOH 02 | STX 03 | ETX 04 | EOT 05 | ENQ · I really want to disable this, because whenever I accidentally press a key combination like this while coding, it causes a great deal of headaches. ... There are some techniques for doing this, found HERE. ... Since this seems to be sort of a FAQ, I’ve begun a “fix” to Notepad++ source code to be able to control this behavior; see HERE for the “issue” and then see the FIX.
🌐
Safe
knowledge.safe.com › questions › 67330 › csv-file-with-soh-control-character-as-separator.html
CSV file with SOH control character as separator | Community
April 2, 2018 - What do I type as the separator for the CSV reader? I've tried the hex code (\\x01) and copying/pasting the SOH character from Notepad++ but neither work. ... Hi @aaron, a workaround I can think of is to read the source file with the Text File reader, replace \\x01 with a normal delimiter character (e.g.
🌐
W3Schools
w3schools.io › editor › notepad++-view-hidden-chars
How do view special hidden characters in notepad++ Text file? - w3schools
December 31, 2023 - Also, there are other options to the Show Symbol menu item. ... Go to View Menu > Select Show Symbol > Uncheck Show End of line. It removes and hides all characters such as CRLF in the opened file.
🌐
SourceForge
sourceforge.net › home › browse › notepad++ › discussion
Notepad++ / Discussion / [READ ONLY] Open Discussion: Text File Special Characters?
March 31, 2015 - This PDF file, below, will give you the complete name of these controls, according to their short name ( NUL, SOH, STX,... ) ... There are 32 "CO Controls" with Unicode code-point between 0 and 1F, in hexadecimal or between 0 and 31 in decimal · Some of these Control codes are normally used by Notepad++ ( and other editors either !
🌐
YouTube
youtube.com › the computer oracle
What does STX, SOH, and GS mean in Notepad++ output? - YouTube
--------------------------------------------------Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn-------------------------------...
Published   January 1, 2024
Views   116
🌐
Blogger
metadataconsulting.blogspot.com › 2023 › 09 › How-to-remove-all-control-characters-in-Notepad2b2b.html
Metadata Consulting [dot] ca - Award Winning Software Blog: How to remove all control characters in Notepad++
September 1, 2023 - Notepad++ indicated control characters with white lettering on a black background such as SOH, STX, ETX, EOT, BS, etc, which you can easily match to tables below. For example, the character named 'bell' ('\a') will be displayed as BEL as indicated by the Acronym column in the table below. 5. Now remove control characters using Find and Replace