- changed status to new
buildList() from Parameters.load() fails with "\r\n" on Windows
Original [issue 68](https://code.google.com/p/okapi/issues/detail?id=68) created by vasilie... on 2009-05-11T18:05:14.000Z:
net.sf.okapi.common.ParametersString.java, line 132:
buildList() called from Parameters.load() doesn't work correctly on Windows
with "
r
n" line breaks:
for the string sendEmptyLines.b=true in a parameters file being read, the line 132
"true".equals(line.substring(n+1)) returns false on Windows, as the
line.substring(n+1) gives "true
r", and not "true".
The lines 136 and 139 will also catch
r.
The reason is line 121
String[] lines = data.split("
n", 0)
leaves
r in the strings after splitting them with "
n".
Stack: ParametersString.buildList(String, String) line: 131 ParametersString.fromString(String) line: 49 ParametersPT.fromString(String) line: 48 ParametersPT(BaseParameters).load(String, boolean) line: 73
Suggested workaround: add normalization of line breaks for parameter files.
Comments (4)
-
Account Deleted -
Account Deleted Comment [2.](https://code.google.com/p/okapi/issues/detail?id=68#c2) originally posted by vasilie... on 2009-05-11T18:09:57.000Z:
-
Account Deleted - changed status to open
Comment [3.](https://code.google.com/p/okapi/issues/detail?id=68#c3) originally posted by @ysavourel on 2009-05-11T19:33:15.000Z:
Good catch. We probably didn't see it because params files using this class were created/edited from the UI, not a text editor. It should be fixed now. Unit tests for it have been added too.
-
Account Deleted - changed status to resolved
Comment [4.](https://code.google.com/p/okapi/issues/detail?id=68#c4) originally posted by @ysavourel on 2009-05-11T19:33:40.000Z:
- Log in to comment
Comment [1.](https://code.google.com/p/okapi/issues/detail?id=68#c1) originally posted by vasilie... on 2009-05-11T18:06:43.000Z: