nicoscandolo commented on code in PR #2251:
URL: https://github.com/apache/stormcrawler/pull/2251#discussion_r4341926736
##########
core/src/main/java/org/apache/stormcrawler/util/CharsetIdentification.java:
##########
@@ -61,6 +61,18 @@ public class CharsetIdentification {
*/
public static String getCharsetFast(
final Metadata metadata, final byte[] content, final int
maxLengthCharsetDetection) {
+ return getCharsetFast(metadata, content, maxLengthCharsetDetection,
"");
Review Comment:
Makes sense, removed both 3-arg methods. Nothing outside the tests used
them, and those now pass an empty prefix.
##########
core/src/main/java/org/apache/stormcrawler/util/CharsetIdentification.java:
##########
@@ -92,11 +111,31 @@ public static String getCharsetFast(
/**
* Identifies the charset of a document based on the following logic:
guess from the
* ByteOrderMark - else if the same charset is specified in the http
headers and the html
- * metadata then use it - otherwise use ICU's charset detector to make an
educated guess and if
- * that fails too returns UTF-8.
+ * metadata then use it - otherwise use ICU's charset detector to make an
educated guess, with
+ * the html metadata or else the http headers as a hint, and if that fails
too returns UTF-8.
+ *
+ * @deprecated reads the HTTP Content-Type without a prefix, while fetched
metadata carries the
+ * one set by protocol.md.prefix: use {@link #getCharset(Metadata,
byte[], int, String)}
*/
+ @Deprecated
Review Comment:
Done, removed as well (same commit).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]