Skip to content
rdipardo edited this page Nov 20, 2024 · 5 revisions

How do I…

Insert special characters?

Entities

  1. Select the text of an entity
  2. Plugins > HTML Tag > Decode entities

Unicode

  1. Select the text of a Unicode escape character
  2. Plugins > HTML Tag > Decode JS

Example

htmltag-decode-selections

Version 1.4.0 and later

Tip

Commands triggered by keyboard shortcut will always decode as you type; you do not need to activate automatic decoding. Just position the caret after the target text and execute one of the commands mentioned below.

Entities
  1. Select Automatically decode entities from Plugins > HTML Tag
  2. Type an entity
  3. Either:
    1. Press SPACE or ENTER, or,
    2. Press the shortcut for the Decode entities command

Example

htmltag-decode-entities-as-you-type
Unicode
  1. Select Automatically decode Unicode characters from Plugins > HTML Tag
  2. Type a Unicode escape character
  3. Either:
    1. Press SPACE or ENTER, or,
    2. Press the shortcut for the Decode JS command

Example

htmltag-decode-unicode-as-you-type

Version 1.4.2 and later

Unicode only
  1. Select Plugins > HTML Tag > About and click “Configure” below the heading that shows the current Unicode character format
  2. Modify the escape character prefix
  3. Select or type a Unicode escape character in the format you specified

Example

htmltag-decode-custom-format-unicode

Note

The prefix will be converted to a regular expression pattern before searching the document. Each of the following characters will be escaped by the plugin, so you can enter them literally (with no preceding \): ., *, +, ?, ^, $, {, }, (, ), [, ], |.

Important

There is one exception to the above. To use a single backlash as prefix (i.e., \0000), you need to escape the prefix character like this: \\, i.e., enter \ twice.

Encode and decode entities or Unicode characters with code points between U+010000 and U+10FFFF?

Version 1.5.1 and later

Exactly as above; see here , here, here and here.

Decode Unicode characters with code points between U+010000 and U+10FFFF?

Version 1.5.0 and later

As above; see here and here.

Older versions (Html Tag <= 1.4.4)


HTML Tag represents Unicode text in UTF-16 encoding. This is the same encoding traditionally used by the Windows operating system, and hence by Notepad++.

A single code point in a UTF-16 string can have a maximum value of 0xFFFF, or 16 consecutive 1 bits. Code points above 0xFFFF can still be represented, using two code points that, taken together, form a surrogate pair.

As an example:

  • Make sure HTML Tag is at least version 1.4
  • Paste this emoji into a new buffer: 🍪 (U+1F36A)
  • Select the emoji and run the Encode JS command; the cookie will be broken into the escape characters \uD83C\uDF6A
  • Select all the text, run the Decode JS command, and confirm that the cookie appears again

To decode any Unicode character between U+010000 and U+10FFFF, you will need to:

  1. Find the “high” and “low” surrogate for the character. You can use an online tool, or implement an algorithm in the programming language of your choice
  2. Type or paste the high surrogate, followed by the low surrogate, both in your preferred escape character format
  3. Run the Decode JS command after selecting the pair, or after placing the caret beside them

Copy/Cut/Replace sections of (X/HT)ML?

  1. Select:
    1. the entire element (tags and child elements): Plugins > HTML Tag > Select tag and contents, or,
    2. only the child elements: Plugins > HTML Tag > Select tag contents only
  2. Copy/Cut the selection

Example

htmltag-replace-xml-section

Copy/Cut/Replace folded sections of (X/HT)ML?

Exactly as above.

Example

htmltag-replace-a-folded-xml-section

Note

Since plugin version 1.4.1, folded sections will also be expanded by any of the ...tag commands.
In older versions, the selection range is the same, but remains folded.