[
https://issues.apache.org/jira/browse/TIKA-2248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15836628#comment-15836628
]
Tim Allison commented on TIKA-2248:
-----------------------------------
I haven't done this in a while, but your class should be somewhere on the
classpath (obviously), and you'll need to modify the EncodingDetector's service
file.
Delete these lines:
{noformat}
org.apache.tika.parser.html.HtmlEncodingDetector
org.apache.tika.parser.txt.UniversalEncodingDetector
org.apache.tika.parser.txt.Icu4jEncodingDetector
{noformat}
and add your class.
If you're using the tika-app.jar, unzip it (I know, the horror) and modify
/META-INF/services/org.apache.tika.detect.EncodingDetector. If you're building
Tika from scratch, that file lives in
tika-parsers/src/main/resources/META-INF/services.
> How to set up the content encoding
> ----------------------------------
>
> Key: TIKA-2248
> URL: https://issues.apache.org/jira/browse/TIKA-2248
> Project: Tika
> Issue Type: Wish
> Reporter: Aldo
> Priority: Trivial
>
> If I try to set up content encoding with
> Metadata metadata = new Metadata();
> metadata.add(Metadata.CONTENT_ENCODING, DATAFILE_CHARSET);
> String parsedString = tika.parseToString(inputStream, metadata);
> metadata CONTENT_ENCODING is ignored;
> How I can force Tika to use CONTENT_ENCODING setted in metadata?
> Thank you.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)