This is a Notepad++ plugin for escaping and unescaping JSON strings.
TL;DR: See the Official plugin installation HOWTO
Open the Releases page to view all available releases.
Download the latest 32-bit version (Release_x86.zip).
Unzip Release_x86.zip to %PROGRAMFILES(x86)%\Notepad++\plugins\NppJsonEscapeUnescapePlugin\NppJsonEscapeUnescapePlugin.dll.
Usually, %PROGRAMFILES(x86)% = C:\Program Files (x86).
Download the latest 64-bit version (Release_x64.zip).
Unzip Release_x64.zip to %PROGRAMFILES%\Notepad++\plugins\NppJsonEscapeUnescapePlugin\NppJsonEscapeUnescapePlugin.dll.
Usually, %PROGRAMFILES% = C:\Program Files.
Plain and simple JSON escape.
sample "string"\ => "sample \"string\"\\"
{"a": "test"} => "{\"a\": \"test\"}"
And so on.
Plain and simple JSON unescaping. It can unescape both some string and "some string".
Note: Input must be a valid JSON-escaped string.
"test \"string\"\\n" => test "string"\n
test \"string\"\\n => test "string"\n
{\"a\": \"123\\n\"} => {"a": "123\n"}
And so on.
This mode is a bit more complex.
If the input is "some string" or some string, it behaves like a simple unescape (see above).
If the input is valid JSON (e.g. {"a": 1}) or valid escaped JSON (e.g. "{\"a\": \"string\"}", with or without outer quotes), it performs the following:
- Parses the input as JSON.
- Recursively traverses all nodes.
- For string nodes, attempts to parse their contents as JSON and replaces the string value with the resulting object.
"{\"a\": \"string\"}" => {"a":"string"}
{\"a\": \"string\"} => {"a":"string"} (same as above but without outer quotes)
"{\"a\":1,\"b\":\"{\\\"c\\\": 1}\"}" => {"a":1,"b":{"c":1}}
{"a": "{\"b\":\"{\\\"c\\\": \\\"string\\\"}\"}"} => {"a":{"b":{"c":"string"}}}
And so on.
Since this is an open-source project from an independent developer, do not blindly trust it.
Please verify the repository before building.
The .gitmodules file should should reference the official JsonCpp repository.
The build_jsoncpp_x32.bat and build_jsoncpp_x64.bat files should contain only build-related commands.
The codebase is small — just read it. There should be no suspicious elements such as network operations, process creation, or obfuscated code.
Visual Studio 17 2022
- Desktop development with C++
- Windows SDK
- C++ CMake tools for windows
- Python development
- Python 3
git clone https://github.com/RolandTaverner/npp-json-escape-unescape-plugin.git
You can build 32-bit (x86), 64-bit (x86-64) library versions or both if you need them all.
If Visual Studio is installed in a non-standard location, modify the path to vcvarsall.bat at the beginning of build_jsoncpp_x32.bat and build_jsoncpp_x64.bat. Alternatively, open the VS 2022 x64 Developer Command Prompt and run the build commands manually without calling vcvarsall.bat explicitly.
Run build_jsoncpp_x32.bat.
After a successful build, the following files will be created:
npp-json-escape-unescape-plugin\3rdparty\jsoncppbuild\build_Win32\lib\Debug\jsoncpp.libnpp-json-escape-unescape-plugin\3rdparty\jsoncppbuild\build_Win32\lib\Release\jsoncpp.lib
Run build_jsoncpp_x64.bat.
After a successful build, the following files will be created:
npp-json-escape-unescape-plugin\3rdparty\jsoncppbuild\build_x64\lib\Debug\jsoncpp.libnpp-json-escape-unescape-plugin\3rdparty\jsoncppbuild\build_x64\lib\Release\jsoncpp.lib
The solution file is located at: npp-json-escape-unescape-plugin/vs.proj/NppJsonEscapeUnescapePlugin.sln
- Don Ho – Author of the lovely Notepad++.
- JsonCpp Community – Authors and maintainers of theJsonCpp library.
- Rajendra Singh – Author of the URL plugin used as a reference.
- molsonkiko – Author of the JsonTools plugin, which I use every day.