Issue Details (XML | Word | Printable)

Key: BATCH-575
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Lucas Ward
Reporter: Gregory Kick
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

FlatFileItemReader default charset should mimic java's default charset behavior

Created: 10/Apr/08 04:31 PM   Updated: Wednesday 03:06 PM
Component/s: Infrastructure
Affects Version/s: 1.0.0
Fix Version/s: 2.0.0.M2

Time Tracking:
Original Estimate: 0.06d
Original Estimate - 0.06d
Remaining Estimate: 0d
Time Spent - 0.12d
Time Spent: 0.12d
Time Spent - 0.12d


 Description  « Hide
currently the default charset is ISO-8859-1, but this is not consistent with the rest of the java platform. Charset uses:

 public static Charset defaultCharset() {
synchronized (Charset.class) {
if (defaultCharset == null) {
java.security.PrivilegedAction pa =
new GetPropertyAction("file.encoding");
String csn = (String)AccessController.doPrivileged(pa);
Charset cs = lookup(csn);
if (cs != null)
return cs;
return forName("UTF-8");
}
return defaultCharset;
}
    }

this method is only available in java 1.5, but is consistent with the behavior of methods like String.getBytes() and OutputStreamWriter, which are in earlier versions.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Dave Syer added a comment - 11/Apr/08 01:52 AM
We can probably address that by using native Java features in Spring Batch 2.0 (which is Java 5).

Thomas Risberg added a comment - 02/Oct/08 01:59 PM
Changed to use default returned from java.nio.charset.Charset. Reassigned for review.