INF parser in Rust
This is a Windows INF file parser library. Supports UTF-8 & UTF16-LE formats of INF files.
Features
- Parse Windows INF files in both UTF-8 and UTF-16LE formats
- Support for section-based parsing
- Handle key-value pairs and standalone values
- Support for quoted values and line continuations
- Comprehensive error handling
- UTF-16LE BOM detection and handling
- Debug logging for detailed parsing information
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
= "0.4.20"
= "0.10.1" # Optional, for logging configuration
Basic usage example:
use WinInfFile;
use PathBuf;
use Env;
Logging
The library uses the log crate for debug logging. To see debug messages, you can:
- Use
env_loggeras shown in the example above - Set the
RUST_LOGenvironment variable todebugortrace - Or configure your own logger implementation
About UTF16-LE
- INF files are UTF16-LE (unicode 16 Little Endian) format. Ref https://learn.microsoft.com/en-us/windows-hardware/drivers/display/general-unicode-requirement
- How UTF-16 LE works
- Each Unicode code point is encoded using either one or two 16-bit code units
- Code points less than 216 are encoded with a single 16-bit code unit
- Code points greater than or equal to 216 are encoded using two 16-bit code units
- The two 16-bit code units for code points greater than or equal to 216 are called a surrogate pair
License
This project is licensed under the MIT License - see the LICENSE file for details.