Back to unescaping, we should also escape characters on saving, it can be done with this change in BasePropertiesConfiguration:
@@ -428,7 +429,7 @@
{
write(key);
write(" = ");
- write(value != null ? value : "");
+ write(value != null ? StringEscapeUtils.escapeJava(value) : "");
write('\n');
}Emmanuel Bourg
Eric Pugh wrote:
Re: [configuration] unescaping propertiesOkay, I'm sold! I guess we can start simple with PropertiesConfiguration and then add it to others if usecases come up. Is there anything else you want in 1.0? Otherwise I want to move to cutting the Release Candatate this weekend.
Eric -----Original Message----- From: Emmanuel Bourg [mailto:[EMAIL PROTECTED] Sent: Thursday, January 29, 2004 2:09 PM To: Jakarta Commons Developers List Subject: Re: [configuration] unescaping properties
I noticed this issue because i needed \n to be handled in my .properties files, that's the only way to have a line return in a property in such a file. The same is not true for a DatabaseConfiguration for example, the value field can store unescaped characters. Same thing for XMLConfiguration, line returns are naturally accepted in the property values and XML entities can be used for special characters. That's why i would say it's a problem specific to PropertiesConfiguration and AbstractConfiguration doesn't need to be modified.
Emmanuel Bourg
Eric Pugh wrote:
> [configuration] unescaping propertiesWell, it seems like if it is good > enough for Propertiesconfiguration, then it is good enough for all of them, > right? Unless this should be decorator? Would you always want to escape > these characters? What happens if you don't escape them? > > Eric
smime.p7s
Description: S/MIME Cryptographic Signature
