Skip to content

Unexpected results when saving and loading values containing newlines #2

@njcrawford

Description

@njcrawford

When setting a value containing newlines, they can be retrieved just as they were set until being saved to a file. When the newlines are saved to file and read back, they are interpreted as separate lines and no longer parts of the value.

IniFile iniFile = new IniFile();
string value = "one
two
three";
iniFile.setValue('test', value);
iniFile.save();
// Reload file from disk
iniFile = new IniFile();
string after = iniFile.getValue('test');

At this point, after contains "one" instead of "one\ntwo\nthree".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions