Copy encoding fixes from loadFile() to reloadBuffer()#2633
Closed
vlakoff wants to merge 1 commit intonotepad-plus-plus:masterfrom
Closed
Copy encoding fixes from loadFile() to reloadBuffer()#2633vlakoff wants to merge 1 commit intonotepad-plus-plus:masterfrom
vlakoff wants to merge 1 commit intonotepad-plus-plus:masterfrom
Conversation
Contributor
Author
|
Of course, you might want to factorize this code from |
755c38b to
3fd19a7
Compare
Member
|
@vlakoff Have you tested your PR? |
Contributor
Author
|
I cannot compile, I just copied the existing code.
|
Member
|
I can reproduce the bug. But your PR doesn't work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(noticed this while investigating #1874)
Copy some code from
FileManager::loadFiletoreloadBuffer, to fix two bugs also when reloading file from disk. I think the bug 1 is quite important, as it affects "reload from disk" in a very common scenario (ANSI-only content, but force-detected as UTF-8 without BOM).Bug 1:
Bug 2:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ééé.htmlextension. Close the file.By the way, maybe we should drop the
getHtmlXmlEncodingmethod. For instance look at the HTML regexes, they are outdated (no html5), not flexible and in most cases wouldn't match. Also, I think this method does more harm than good. These <meta> tags don't determine the file encoding, but the expected file encoding.