Daniel John Debrunner wrote:

Would it be safer to use standard Java character reading classes, rather
than inventing your own here?

Use something like

new LineNumberReader(new InputStreamReader(is, "ISO 8859-1"));

since property files are defined to be that encoding?

I think there were two reasons why I created a readLine() method instead of using an existing Java one: 1) because, for whatever reason, I thought that backslashes needed special handling (and hence a standard Java "readLine()" wouldn't have worked), and 2) there are some character-related operations that have to be done (esp. right-side trimming to find the last non-whitespace character) and I thought that it'd be cleaner to do that character processing while reading, instead of getting a string and processing it character by character.

But now that reason #1 is void and since reason #2 isn't really much of a reason, Yes, it would be safer to use standarad Java character reading classes. I'll make that change and post a patch soon.

Army

Reply via email to