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

Add new encoding "UTF-8 without BOM" #3979

Merged
merged 5 commits into from Feb 9, 2020

Conversation

@niksedk
Copy link
Member

niksedk commented Feb 9, 2020

Notepad and Notepad++ (now) have two different encodings for UTF-8 - with and without BOM, and there seems to be more and more requests about this - like #3972.

This PR will rename the old "UTF-8" to "UTF-8 with BOM" and add a new encoding to the encodings combo-box in the UI:
image
Also, the "secret" setting WriteUtf8Bom has been removed.

ATM, BOM is not really part of the Encoding object in C#, so it requires a bit more care than just an normal Encoding.

encodingName.Equals(TextEncoding.Utf8WithoutBom.Replace(" ", "-"), StringComparison.OrdinalIgnoreCase))
{
targetEncoding = new TextEncoding(Encoding.UTF8, TextEncoding.Utf8WithoutBom);
}
if (encodingName.Length > 0)

This comment has been minimized.

Copy link
@xylographe

xylographe Feb 9, 2020

Member
else if (encodingName.Length > 0)
@niksedk niksedk merged commit 0f28d05 into master Feb 9, 2020
2 of 3 checks passed
2 of 3 checks passed
Codacy/PR Quality Review Not up to standards. This pull request quality could be better.
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@niksedk niksedk mentioned this pull request Mar 1, 2020
4 of 4 tasks complete
@OmrSi

This comment has been minimized.

Copy link

OmrSi commented Mar 16, 2020

@niksedk Is the default without BOM?

@niksedk

This comment has been minimized.

Copy link
Member Author

niksedk commented Mar 16, 2020

Yes, the default is with BOM as it has always been (you can change the default in Option - Settings though)

@OmrSi

This comment has been minimized.

Copy link

OmrSi commented Mar 16, 2020

Cool. It must have been a problem with my settings, it defaulted to "without BOM" for some reason.
Thank you.

@niksedk

This comment has been minimized.

Copy link
Member Author

niksedk commented Mar 16, 2020

Oh, if you open a file already in "UTF-8 wihtout BOM" that encoding will be kept.

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.