Stop Jsoup from coding

I'm trying to parse a URL with JSoup, which contains the following text: Ætterni. After parsing the document the same line looks like this: Ætterni.

How to prevent this form? I want the 1: 1 document to be exactly the same as it was.

the code:

doc = Jsoup.connect(url).get();
String docEncoding=doc.outputSettings().charset().name();
OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(localLink),docEncoding);
writer.write(doc.html());
writer.close();
+3
source share
2 answers

Use    doc.outputSettings().escapeMode(EscapeMode.xhtml); to avoid entity transformations.

+4
source

You do not seem to use the power of Jsoup in any way. I just passed the HTML form using java.net.URL. So you have a copy of the answer 1: 1.

InputStream input = new URL(url).openStream();
OutputStream output = new FileOutputStream(localLink);
// Now copy input to output the usual Java IO way.

Reader/Writer , , .

+2

All Articles