Is a lone linefeed (0x0A) a violation of the INI format?
题
Is it a violation if the INI format to have a single linefeed (0x0A) that is not preceded by a carraige return (0x0D)?
Ini4j is puking on this in my Android app.
Please abstain from asking why I'm using INI in an Android app...
解决方案
Since *.ini
is a windows format, you can expect, that each newline must be \r\n
.
At least in the sources, only the Registry
class definitivly relies on \r\n
. In all other cases it seems, as if the system property line.separator
is used.
It's still arguable is a cross-plattform library should rely on it...
The problem can be resolved setting setEmptyOption(true)
e.g.
Config c = new Config();
c.setEmptyOption(true);
Ini i = new Ini();
i.setConfig(c);
不隶属于 StackOverflow