Skip to content

v2.1.0

Choose a tag to compare

@0xLaileb 0xLaileb released this 28 Sep 02:39
· 2 commits to master since this release

Highlights

Unicode INI files out of the box. Windows creates missing INI files in the system ANSI code page, so text outside it (CJK, emoji, and on many systems Cyrillic) was silently saved as ?. Write, DeleteKey, and DeleteSection now create a missing or empty file as UTF-16 LE with a byte order mark, the only Unicode encoding the Windows profile API supports (it does not support UTF-8). Existing files with content keep their encoding.

Fixed

  • KeyExists returned false for existing keys when the key names of a section exceeded 32,768 characters. It also disagreed with ReadString in some cases: a padded key (" Key ") was reported as missing although ReadString found it, and a non-ASCII key in a different case was reported as present although ReadString did not find it. KeyExists now uses the same lookup as ReadString, has no section size limit, and no longer allocates a 64 KB buffer per call.
  • GetAllSections(2) / GetAllDataSection(section, 2) silently returned an empty array for non-empty data. The minimum bufferSize for list reads is now 3, matching ReadString enumeration; smaller values throw ArgumentOutOfRangeException.
  • Concurrent first writes to a new file from several threads no longer fail with a sharing violation.
  • The package release notes link pointed to a non-existent tag.

Changed

  • New or empty files are UTF-16 LE (see above). If a legacy tool needs an ANSI file, create the file yourself before the first write.
  • InvalidOperationException messages for list reads now mention the actual buffer size.
  • The build no longer references Microsoft.SourceLink.GitHub 8.0.0, which pulled in a vulnerable Microsoft.Build.Tasks.Git (build-time only; Source Link is built into the .NET SDK and still works). The package has no runtime dependencies, as before.
  • Package validation now compares each build against 2.0.4 to catch accidental public API removals.

Documentation

The README now includes a Limitations section (encoding, 32,767-character values, error codes via Marshal.GetLastPInvokeError(), case sensitivity), plus buffer size ranges and exceptions. It also removes the incorrect advice that consumers must enable AllowUnsafeBlocks.

No public API was added or removed.

Full Changelog: 2.0.4...2.1.0