[
https://issues.apache.org/jira/browse/NUTCH-1098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128372#comment-13128372
]
Sebastian Nagel commented on NUTCH-1098:
----------------------------------------
It depends on the used browser and where the query is entered (in the URL line
or in a form field, cf.
http://en.wikipedia.org/wiki/URL_encoding#The_application.2Fx-www-form-urlencoded_type).
>From the user perspective it seems to be irrelevant how a query containing
>spaces is encoded. For both
http://www.google.com/search?q=nutch+crawler
http://www.google.com/search?q=nutch%20crawler
you get the same result page. Servlets are not sensitive to whether `+' or
`%20' represents a space (at least, if standard decoding routines are used).
But despite the question what browsers are doing a URL normalizer should
replace the space because:
1. fetching URLs containing spaces may fail (it will with httpclient)
2. avoid fetching the same document twice by two variant URLs
Since the first and more severe problem is fixed I opt for applying the patch
"as is". But we should keep point 2 on the radar for a later improvement.
I think BasicURLNormalizer is the right place for a solution because a
position-dependent replacement by `%20' or `+' before resp. after `?' can
hardly be expressed by a single regular expression and hence cannot be done by
adding a rule to RegexURLNormalizer.
> better url-normalizer basic
> ---------------------------
>
> Key: NUTCH-1098
> URL: https://issues.apache.org/jira/browse/NUTCH-1098
> Project: Nutch
> Issue Type: Improvement
> Components: fetcher
> Affects Versions: 1.3
> Environment: Any
> Reporter: Radim Kolar
> Assignee: Markus Jelsma
> Labels: encoding, url
> Fix For: 1.4
>
> Attachments: nutch.diff
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> Basic URL normalizer lacks 2 important features
> Encode space in URL into %20 to unbreak httpclient and possibly others who do
> not expect space inside URL
> Ability to decode %33 encoding in URL. This is important for avoiding
> duplicates
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira