Git Product home page Git Product logo

Comments (6)

AxelTechnology avatar AxelTechnology commented on July 20, 2024 1

Sorry, my fault, I trusted Windows.
In reality there is no problem.

I explain to you:
To check if a file is ANSI or UTF-8 I use Notepad or Notepad++.
It seems that Windows 10, from a certain update onwards, has changed the way of interpreting files without headers, and instead of calling them ANSI it calls them UTF-8, while UTF-8 with headings calls them UTF-8 with BOM

(see image)
compare
.

So, never mind and thank you again.

from peanutbutter.

fluffynuts avatar fluffynuts commented on July 20, 2024

I have modified a test to use the encoding as you pass it and the test doesn't throw this error, so I need more info; specifically, the file you're dealing with, so I can track down the issue.

from peanutbutter.

AxelTechnology avatar AxelTechnology commented on July 20, 2024

I've created a simple example to reproduce the error.
TestPBINI.zip

If not present, put the file DATI.TXT inside the build folder.
Thank you.

from peanutbutter.

fluffynuts avatar fluffynuts commented on July 20, 2024

Please see release 2.0.76 - should resolve the issue.

from peanutbutter.

AxelTechnology avatar AxelTechnology commented on July 20, 2024

The error is gone, but now I've seen that the
mIniFile.Persist(Encoding.GetEncoding(1252)); //Save in ANSI

is no longer working, the file is saved always in UTF-8.
At the moment, I'm not sure if this behaviour is regarding the latest version or if is something else.

from peanutbutter.

fluffynuts avatar fluffynuts commented on July 20, 2024

I don't see how though? That's

public void Persist(Encoding encoding)
{
Persist(
null as string,
PersistStrategies.ExcludeMergedConfigurations,
encoding
);
}
, which like other Persist methods, ends up going through
public void Persist(
string saveToPath,
PersistStrategies persistStrategy,
Encoding encoding
)
{
if (encoding is null)
{
throw new ArgumentException(nameof(encoding));
}
saveToPath = CheckPersistencePath(saveToPath);
var lines = GetLinesForCurrentData(persistStrategy);
File.WriteAllBytes(
saveToPath,
encoding.GetBytes(
string.Join(Environment.NewLine, lines)
)
);
}
, where we use File.WriteAllBytes with the provided encoding. What's the example?

from peanutbutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.