Changeset 11511


Ignore:
Timestamp:
12/30/08 12:15:04 (13 years ago)
Author:
vvoutilainen
Message:

Use replacement characters for unmappable and malformed
data. This makes the reader more lenient and allows
cl-bench to compile and run out-of-the-box on current
ubuntu installations, for example. At some point, we
may want to add user-definable strategies for handling
unmappable/malformed data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/util/RandomAccessCharacterFile.java

    r11431 r11511  
    5050import java.nio.charset.CharsetEncoder;
    5151import java.nio.charset.CoderResult;
     52import java.nio.charset.CodingErrorAction;
    5253
    5354public class RandomAccessCharacterFile {
     
    277278  cset = (encoding == null) ? Charset.defaultCharset() : Charset.forName(encoding);
    278279  cdec = cset.newDecoder();
     280  cdec.onMalformedInput(CodingErrorAction.REPLACE);
     281  cdec.onUnmappableCharacter(CodingErrorAction.REPLACE);
    279282  cenc = cset.newEncoder();
    280283   
Note: See TracChangeset for help on using the changeset viewer.