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);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top