You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2025/11/27 12:26:18 UTC

[I] Consider using Apache Tika instead of Plexus for encoding detection [maven-acr-plugin]

elharo opened a new issue, #125:
URL: https://github.com/apache/maven-acr-plugin/issues/125

   ### New feature, improvement proposal
   
   ```
    static String detectEncoding(File file) thjrows IOException {
           Tika tika = new Tika();
               // Tika's detect method checks for explicit declarations (like XML) 
               // and BOMs, then falls back to robust statistical analysis.
               String detectedEncoding = tika.detect(file.toPath());
               
               // Tika's detect() returns a MIME type like "text/plain; charset=UTF-8" or just "UTF-8".
               if (detectedEncoding.contains("charset=")) {
                   return detectedEncoding.substring(detectedEncoding.indexOf("charset=") + 8);
               }
               return detectedEncoding;
       }
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

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


Re: [I] Consider using Apache Tika instead of Plexus for encoding detection [maven-acr-plugin]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed issue #125: Consider using Apache Tika instead of Plexus for encoding detection
URL: https://github.com/apache/maven-acr-plugin/issues/125


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [I] Consider using Apache Tika instead of Plexus for encoding detection [maven-acr-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on issue #125:
URL: https://github.com/apache/maven-acr-plugin/issues/125#issuecomment-3626895883

   given that we already have Plexus it's almost certainly bigger. However, unlike plexus this is the core purpose of Apache tika, and has much more testing and consideration of different cases and edge conditions. 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [I] Consider using Apache Tika instead of Plexus for encoding detection [maven-acr-plugin]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on issue #125:
URL: https://github.com/apache/maven-acr-plugin/issues/125#issuecomment-3638914500

   Another alternative  `com.ibm.icu:icu4j`


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [I] Consider using Apache Tika instead of Plexus for encoding detection [maven-acr-plugin]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on issue #125:
URL: https://github.com/apache/maven-acr-plugin/issues/125#issuecomment-3623236022

   how big is tika dependency vs plexus?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [I] Consider using Apache Tika instead of Plexus for encoding detection [maven-acr-plugin]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on issue #125:
URL: https://github.com/apache/maven-acr-plugin/issues/125#issuecomment-5973234964

   The deployment descriptor's encoding is detected by commons-io's `XmlStreamReader` (since bb52b1d, not Plexus), which applies the XML spec's rules: BOM, then the `encoding` declaration, then UTF-8. Statistical detection only helps for text that doesn't declare its encoding, and `application-client.xml` always can. Closing as not planned; reopen with a descriptor that `XmlStreamReader` misreads.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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