This topic refers only to program developers
Character Set
The entire INI file, including section names, key names and data values is encoded using 8-bit characters in the ISO 8859-1 character set (of which 7-bit ASCII is a subset). Application-specific string values may store data using other character sets, and even binary data, as long as they are encoded as either ASCII or ISO 8859-1 text. ANSI C Escape sequences are used for the encoding of special characters in strings.
[SectionName]
keyname=value
;comment
Section names are enclosed in square brackets, and must begin at the beginning of a line. There can be only one section name per INI file.
Section and key names are case-insensitive. In consideration of possible future upgrades from INI to XML, authors of INI files may want to use consistent and case-exact section and key names, as if INI parsers were case-sensitive (XML parsers are case-sensitive).
Section and key names cannot contain spacing characters. The key name is followed by an equal sign ("=", ASCII decimal code 61), optionally surrounded by spacing characters, which are ignored.
String Values
String values may optionally be enclosed in quote characters (""", ASCII decimal code 34). String values beginning or ending with spaces, or containing commas or semicolons, must be enclosed in quotes. Quote and backslash ("\", ASCII decimal code 92) characters, as well as binary characters (ASCII decimal ranges 0..31, 127..159) appearing inside strings must be escaped by preceding them with a backslash.
The default character set for text appearing inside string values is ISO 8859-1. Applications may define certain sections and/or keys to store text which, from the application side, results as being encoded using different character sets, or even binary data. However, the string data appearing in the INI file must be encoded as ISO 8859-1 text, using escape sequences as necessary, so as to be compatible with INI parsers.
Path Values
Path values are identical to String values, with the exception that escape sequences introduced by the backslash character are not supported. Path values are used to represent filing system and registry paths, where for clarity it is not desirable to use double backslash characters ("\\") to indicate backslash characters inside paths. This means that a path like "C:\readme.txt" would remain unchanged (whereas it would have to be indicated as "C:\\readme.txt" in a String field).
Numerical Values
In numerical values, the period (".", ASCII decimal code 46) is the only valid decimal separator. Leading zeros are optional (e.g. "0.5", "000.5" and ".5" are all valid representations for the same value, i.e. 0.5). For consistency, one leading zero (e.g. "0.5") is the preferred format to represent values smaller than 1.
Trailing zeroes may be used on an application-dependent basis, for example to express precision (e.g. "0.50", opposed to "0.5", may indicate that the smallest currency unit is equal to fifty "cents", as opposed to five "tenths" of the full unit, and "1.234000" may indicate to use a precision of six decimal digits in partial or total results).