All contributions

QEDK/configparser-rs

configparser

A simple INI configuration parser in Rust with no dependencies and configurable key-value delimiters.

Language
Rust
GitHub stars
88
Merged changes
1
Project site
crates.io

What we changed

Parsing with a multi-byte delimiter, such as the § sign, no longer panics and returns the right value.

What this work shows

  • UTF-8 encoding and char boundaries
  • INI format parsing
  • Regression tests in Rust
What was broken

A § delimiter crashed the parser

The delimiters field is public and accepts any character. With §, which takes two bytes in UTF-8, Ini::parse sliced the text one byte past the delimiter, in the middle of the character, and panicked with "not a char boundary".

How we fixed it

Stepping by the character's length

The parser now steps past the delimiter by its real UTF-8 length from char::len_utf8, so nothing changes for the single-byte = and :. The multibyte_delimiter_does_not_panic test checks that the value after § is read correctly.

#61

Merged change 1

  1. #61 Fix panic when parsing with a multi-byte delimiter Merged 6 September 2026

What it taught us

In Rust a string index is a byte, not a character. Slicing inside a UTF-8 character panics, so we compute the step from the character's length rather than assume every delimiter is one byte.

More about this technology: Rust

Other projects we write code for

Describe your project.

A free quote comes back within an hour during working hours.