You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notepad++ internally represents files with most encodings as UTF8,
but ANSI files are internally represented as ANSI.
Previously JsonTools assumed that any method
that got the bytes of the document from Notepad++
could treat those bytes as UTF8,
and that assumption is wrong for ANSI.
Now JsonTools uses ScintillaGateway.GetCodePage()
to determine the encoding of the document and requires
an encoding as a parameter for many document-text-extracting functions.
However, the JsonParser class is still hardcoded
to count the bytes in the UTF8 representation of each character in a string,
and it would be both annoying and potentially performance-reducing to stop making this assumption.
In a future commit I may address this issue, but for now some features are broken for non-ASCII ANSI files, including the following:
- automagic navigation to position in document of a tree node
- selecting a tree node or its children
- getting the path to a position in the document
- selecting all valid JSON in a selection
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
54
54
55
55
### Fixed
56
56
57
-
1. Bug where JsonTools could not set the text of a file to end with the SOH character (ASCII code `\x01`)
58
-
2. Bug where some JsonGrepper tests would always fail because they queried an external API that had previously returned JSON but now returns HTML.
57
+
1.__Correctly parse all ANSI files.__ Previously JsonTools assumed that Notepad++ used UTF8 to internally represent every document, and while that appears to have worked fine for most encodings, it would specifically fail on ANSI-encoded documents containing non-ASCII.
58
+
-__The following features are currently *still broken* on ANSI files with non-ASCII characters__ (because they rely on knowing the position of a JSON node):
59
+
* [path to current position](/docs/README.md#path-to-current-position)
60
+
* [clicking on a tree node to navigate to its position in the document](/docs/README.md#the-basics)
61
+
* [selecting a tree node or its children](/docs/README.md#select-tree-nodes-json-or-its-children-added-in-v57)
62
+
* [selecting all valid JSON in selection](/docs/README.md#selecting-all-valid-json)
63
+
2. Minor bug where JsonTools could not set the text of a file to end with the SOH character (ASCII code `\x01`)
64
+
3. Minor bug where some JsonGrepper tests would always fail because they queried an external API that had previously returned JSON but now returns HTML.
0 commit comments