You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privateDocumentexecuteRequest(Stringvalue2) throwsIOException {
returnJsoup.connect(DEFAULT_URL)
.timeout(DEFAULT_TIMEOUT)
.data("param1", "value1")
.data("param2", value2)
.userAgent(DEFAULT_USER_AGENT)
.responseEncoding("ISO-8859-1") // <-- This is the setter method I'm suggesting, something like that
.post();
}
The postDataCharset method sets the charset when sending a POST request, but not for parsing the response as a document.
Of course the method name is your choice.
What do you think?
P.S: @krystiangorecki This is the issue with the correct description.
The text was updated successfully, but these errors were encountered:
Thanks, makes sense. Is the site not setting the response encoding in a header or meta though, or is jsoup parsing it incorrectly? Trying to understand the root issue.
In my tests, the site I was scraping didn't bring the encoding in response headers neither in html, but I knew beforehand the proper encoding was ISO-8859-1.
As far as I know, jsoup parses documents as UTF-8 when it can't detect the document encoding, right?
I don't think it is a jsoup bug, more likely a site problem.
Hi,
I'm using your library in some projects here, it's great.
It would be great to have a setter method to set the encoding when parsing a response as a document.
For example, if I need to execute a post request and parse the response as a
Document
with theISO-8859-1
encoding, I have to do this:It would be great something like this:
The
postDataCharset
method sets the charset when sending a POST request, but not for parsing the response as a document.Of course the method name is your choice.
What do you think?
P.S: @krystiangorecki This is the issue with the correct description.
The text was updated successfully, but these errors were encountered: