[ 
https://issues.apache.org/jira/browse/CAMEL-18685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-18685.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/30886 (merged as 
987d93f9a1a52cd4b27de2f8c5d7dd6c883ed2d2 on main, 4.24.0).

_Claude Code on behalf of davsclaus_

> camel-file: charset conversions causing UnmappableCharacterException
> --------------------------------------------------------------------
>
>                 Key: CAMEL-18685
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18685
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-file
>            Reporter: Otavio Rodolfo Piske
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: help-wanted
>             Fix For: 4.24.0
>
>
> In the file component, reading a file that contains an unmappable character 
> causes the component to throw UnmappableCharacterException. 
>  
> This happens because, by default, the behavior for handling unmapped 
> characters in the [Charset class is to report 
> them|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/CharsetDecoder.html#decode(java.nio.ByteBuffer)].
>  
>  
> Ideally, we should allow configuring the behavior so that it can either be 
> replaced or ignored. For instance, we can try tweaking the code to use 
> something like (in FileOperations) to ignore errors:
>  
>  
> {code:java}
> Charset.forName(charset).newDecoder().onMalformedInput(CodingErrorAction.IGNORE).charset();
> {code}
>  
> Ignore is just one of the options. We may also want to try to replace them 
> (as Camel did prior to 2.20).
>  



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to