You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by GitBox <gi...@apache.org> on 2021/04/28 20:59:24 UTC

[GitHub] [tika] tballison commented on a change in pull request #433: [TIKA-3374] Apply charset detection for archive entry name

tballison commented on a change in pull request #433:
URL: https://github.com/apache/tika/pull/433#discussion_r622541769



##########
File path: tika-parsers/tika-parsers-classic/tika-parsers-classic-modules/tika-parser-pkg-module/src/main/java/org/apache/tika/parser/pkg/PackageParser.java
##########
@@ -392,6 +392,15 @@ private void parseEntry(ArchiveInputStream archive, ArchiveEntry entry,
                             XHTMLContentHandler xhtml)
             throws SAXException, IOException, TikaException {
         String name = entry.getName();
+        
+        //Try to detect charset of archive entry in case of non-unicode filename is used
+        if (entry instanceof ZipArchiveEntry) {
+            detector.setText(((ZipArchiveEntry) entry).getRawName());

Review comment:
       This is embarrassing, but where is the detector initialized...how are you getting it?
   
   Maybe have PackageParser extend AbstractEncodingDetectorParser?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org