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

XmlPoke ignores BOM encoding settings #1889

Closed
olsh opened this Issue Oct 23, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@olsh

olsh commented Oct 23, 2017

What You Are Seeing?

XmlPoke saves a file with BOM even if I choose UTF8 without BOM Encoding

What is Expected?

XmlPoke saves an XML file without BOM

What version of Cake are you using?

Cake 0.23.0

Are you running on a 32 or 64 bit system?

64 bit

What environment are you running on? Windows? Linux? Mac?

Windows 10

How Did You Get This To Happen? (Steps to Reproduce)

  1. Copy XML from the example and save it as UTF8 file
    <?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="server" value="testhost.somecompany.com" />
    </appSettings>
</configuration>
  1. Execute code from the example but with Encoding specified
    var file = File("test.xml");
    XmlPoke(file, "/configuration/appSettings/add[@key = 'server']/@value", "productionhost.somecompany.com", new XmlPokeSettings { Encoding = new UTF8Encoding(false) });
  1. The file encoding was changed to UTF8 with BOM
@devlead

This comment has been minimized.

Show comment
Hide comment
@devlead

devlead Oct 23, 2017

Member

Would seem encoding is only used with XmlPokeString and should probably be used here too.

Member

devlead commented Oct 23, 2017

Would seem encoding is only used with XmlPokeString and should probably be used here too.

@Marusyk

This comment has been minimized.

Show comment
Hide comment
@Marusyk

Marusyk Oct 24, 2017

Contributor

Hello, I'll try to fix it

Contributor

Marusyk commented Oct 24, 2017

Hello, I'll try to fix it

Marusyk added a commit to Marusyk/cake that referenced this issue Oct 24, 2017

@devlead devlead added this to the v0.24.0 milestone Oct 24, 2017

@devlead devlead closed this in 571eb52 Oct 24, 2017

devlead added a commit that referenced this issue Oct 24, 2017

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