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

Pretty print: Unintentinally converts amlauta chars #25

Closed
Japollack opened this issue Dec 20, 2022 · 1 comment · Fixed by notepad-plus-plus/nppPluginList#553
Closed

Comments

@Japollack
Copy link

Japollack commented Dec 20, 2022

"Pretty-print current JSON file" command would turn this:
{ "cities": [ "Tallinn", "Pärnu", "Tartu", "Valga", "Jõhvi", "Haapsalu", "Jõgeva", "Võru" ] }

into this:
{ "cities": [ "Tallinn", "P\u00e4rnu", "Tartu", "Valga", "J\u00f5hvi", "Haapsalu", "J\u00f5geva", "V\u00f5ru" ] }

Using Json Tools v4.6.1 with Notepad++ v8.4.7.

The JSON file is saved as UTF-8 BOM with Windows line endings.

Remove the .log from the file name: nppJsonToolUmlautaSample.json.log

PS. Probably the issue lies here:

// The safest thing to do is to use \u notation for everything

@molsonkiko
Copy link
Owner

Hi Japollack, yes, this was an intentional design decision on my part. That said, I agree that it can make JSON with lots of non-ASCII characters less readable. I'm working on this right now and should have a patch finished in a couple of hours.

molsonkiko added a commit that referenced this issue Dec 20, 2022
ADDED
1. Support for extended ASCII characters
    (i.e., anything from `0x7f` (⌂) to `0xff` (ÿ))
    in random JSON.

CHANGED
1. Non-ASCII characters (e.g., 😀, Я) are now
    displayed normally rather than being converted to
    ASCII using the `\u` notation (e.g., `\ud83d\ude00`, `\u042f`).
    Resolve Issue #25.

FIXED
1. Fix bug where find/replace form advanced controls
    would not be toggled if the user manually
    resized the form.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants