UTF8 - Simple Library for Internationalization
Loading...
Searching...
No Matches
INI File Replacement API

An object-oriented replacement for working with INI files. More...

Data Structures

class  utf8::IniFile
 Operations on INI files. More...
 

Detailed Description

An object-oriented replacement for working with INI files.

The basic Windows API functions for reading and writing INI files, [GetPrivateProfileStringW] (https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getprivateprofilestringw) and [WritePrivateProfileStringW] (https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-writeprivateprofilestringw), combine both the file name and the information to be read or written in one API call.

Using the utf8::widen() function to convert all strings passed to this API produces an INI file that contains UTF-16 characters.

The solution is to completely replace the Windows API functions with an IniFile object that is UTF-8 aware and provides a rich interface.

This implementation struggles to be as compatible as possible with the original Windows API. There are no arbitrary extensions to the file format and I've done a lot of testing to identify different corner cases. Here are the rules I discovered by trying different combination of calls to the original Windows API:

The only changes compared to the Windows API are: