Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format JSON replaces unicode characters code with the actual unicode character #78

Open
git-hub-user opened this issue Jun 15, 2020 · 2 comments

Comments

@git-hub-user
Copy link

When I have

{"FreeTextInput":"\u003Cscript\u003Ealert(\u0022links\u0022);\u003C/script\u003E"}

in a Notepad++ editor tab, select the text and apply menu Plugins - JSON Viewer - format JSON, the result is:

{
	"FreeTextInput": "<script>alert(\"links\");</script>"
}

I am not sure if this is by design, but I surely surprised me.

If doesn't matter if the Encoding is set to ANSI or to UTF-8.

@kapilratnani kapilratnani added hacktoberfest Open For Hacktoberfest PRs bug labels Oct 6, 2020
@user21760
Copy link

user21760 commented Nov 10, 2021

The bug is that "Format Json" is unescaping the escaped characters / and u**** in strings, instead of leaving them in the original escaped form.
The escaped characters \ plus ", , b, f, n, r, or t don't change. Maybe it is related to the fact that those characters need to be escaped too in c++, while / doesn't?

@junfoon
Copy link

junfoon commented Oct 19, 2022

现在的文件都是默认的utf-8 ,打开后中文乱码显示为ansi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants