Lizerium.BINI.Converter 1.0.0

dotnet add package Lizerium.BINI.Converter --version 1.0.0
                    
NuGet\Install-Package Lizerium.BINI.Converter -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lizerium.BINI.Converter" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lizerium.BINI.Converter" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lizerium.BINI.Converter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lizerium.BINI.Converter --version 1.0.0
                    
#r "nuget: Lizerium.BINI.Converter, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lizerium.BINI.Converter@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lizerium.BINI.Converter&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lizerium.BINI.Converter&version=1.0.0
                    
Install as a Cake Tool

NuGet Package Usage

Lizerium.BINI.Converter is the reusable library package. Use it when you want BINI conversion inside another .NET application, tool, launcher, editor, or pipeline.

Install

From NuGet:

dotnet add package Lizerium.BINI.Converter

From a local package built from this repository:

dotnet pack app/Lizerium.BINI.Converter/Lizerium.BINI.Converter.csproj -c Release
dotnet add package Lizerium.BINI.Converter --source app/Lizerium.BINI.Converter/bin/Release

Convert BINI To Text INI

using Lizerium.BINI.Converter;

byte[] bini = File.ReadAllBytes("market_commodities.ini");
string textIni = BiniConverter.ConvertBiniToText(bini);

File.WriteAllText("market_commodities.text.ini", textIni);

Convert Text INI To BINI

using Lizerium.BINI.Converter;

string textIni = File.ReadAllText("market_commodities.text.ini");
byte[] bini = BiniConverter.ConvertTextToBini(textIni);

File.WriteAllBytes("market_commodities.ini", bini);

Work With Byte Arrays

using System.Text;
using Lizerium.BINI.Converter;

byte[] textBytes = File.ReadAllBytes("shiparch.text.ini");
byte[] biniBytes = BiniConverter.ConvertTextBytesToBini(textBytes, Encoding.Latin1);

byte[] restoredTextBytes = BiniConverter.ConvertBiniToTextBytes(biniBytes, Encoding.Latin1);

If no encoding is passed, byte/file APIs use BiniEncodings.Windows1251, because many Freelancer files and localized mods store strings as Windows-1251. Pass BiniEncodings.Latin1 when you need byte-preserving behavior for artificial fixtures or legacy data that is not really CP1251 text.

Work With Files

using Lizerium.BINI.Converter;

BiniConverter.ConvertBiniFileToTextFile(
    inputPath: "market_commodities.ini",
    outputPath: "market_commodities.text.ini");

BiniConverter.ConvertTextFileToBiniFile(
    inputPath: "market_commodities.text.ini",
    outputPath: "market_commodities.ini");

Detect Format

using Lizerium.BINI.Converter;

byte[] data = File.ReadAllBytes("file.ini");

if (BiniConverter.IsBini(data))
{
    Console.WriteLine("Binary BINI");
}
else
{
    Console.WriteLine("Text INI");
}

Strict Text Parsing

The default text parser allows Freelancer-style extensions. Use strict mode when you want tighter INI validation:

using Lizerium.BINI.Converter;

byte[] bini = BiniConverter.ConvertTextToBiniStrict(File.ReadAllText("input.ini"));

Public API

  • IsBini(ReadOnlySpan<byte> data) - checks the BINI signature.
  • ConvertTextToBini(string text) - converts text INI to BINI bytes.
  • ConvertTextToBini(string text, Encoding? encoding) - converts text INI to BINI bytes with an explicit string table encoding.
  • ConvertTextToBiniStrict(string text) - converts text INI with stricter parser rules.
  • ConvertTextToBiniStrict(string text, Encoding? encoding) - strict conversion with an explicit string table encoding.
  • ConvertTextBytesToBini(byte[] textBytes, Encoding? encoding = null) - converts encoded text bytes to BINI bytes.
  • ConvertBiniToText(byte[] biniBytes) - converts BINI bytes to text INI.
  • ConvertBiniToText(byte[] biniBytes, Encoding? encoding) - converts BINI bytes to text INI with an explicit string table encoding.
  • ConvertBiniToTextBytes(byte[] biniBytes, Encoding? encoding = null) - converts BINI bytes to encoded text bytes.
  • ConvertTextFileToBiniFile(string inputPath, string outputPath, Encoding? encoding = null) - converts a text INI file to a BINI file.
  • ConvertBiniFileToTextFile(string inputPath, string outputPath, Encoding? encoding = null) - converts a BINI file to a text INI file.

Errors

Invalid text INI or corrupted BINI input throws FormatException.

A text file with too many unique strings for the BINI string table can throw InvalidOperationException.

Need A Ready-To-Run Tool?

Use Lizerium.BINI.Converter.App for file conversion, recursive folder conversion, and the local browser overlay.

See App, CLI, and web overlay.

Example Web-portal - https://lizerium.github.io/Lizerium.BINI.Converter/

Need A Browser-Only Version?

The repository also contains a static JavaScript portal in docs. It exposes window.LizeriumBini and can run from GitHub Pages without a backend.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 125 4/24/2026