ICU-6144 Add new methods to specify callback on malform and unmapple errors.
X-SVN-Rev: 23490
This commit is contained in:
parent
262b4e1c8d
commit
b6df9c649e
@ -129,6 +129,16 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
|
||||
onMalformedInput = getCallback(newAction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the callback decoder method to be used if an illegal sequence is encountered.
|
||||
*
|
||||
* @param newCallback CharsetCallback.Decoder
|
||||
* @exception IllegalArgumentException
|
||||
* @draft ICU 4.0
|
||||
*/
|
||||
public final void onMalformedInput(CharsetCallback.Decoder newCallback) {
|
||||
onMalformedInput = newCallback;
|
||||
}
|
||||
/**
|
||||
* Sets the action to be taken if an illegal sequence is encountered
|
||||
*
|
||||
@ -150,6 +160,17 @@ public abstract class CharsetDecoderICU extends CharsetDecoder{
|
||||
|
||||
onUnmappableCharacter = getCallback(newAction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the callback decoder method to be used if an illegal sequence is encountered.
|
||||
*
|
||||
* @param newCallback CharsetCallback.Decoder
|
||||
* @exception IllegalArgumentException
|
||||
* @draft ICU 4.0
|
||||
*/
|
||||
public final void onUnmappableCharacter(CharsetCallback.Decoder newCallback) {
|
||||
onUnmappableCharacter = newCallback;
|
||||
}
|
||||
private static CharsetCallback.Decoder getCallback(CodingErrorAction action){
|
||||
if(action==CodingErrorAction.REPLACE){
|
||||
return CharsetCallback.TO_U_CALLBACK_SUBSTITUTE;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user