Last active
March 30, 2018 22:00
-
-
Save scotthansonde/c1ea2958d6aea935433873d60b58e6fe to your computer and use it in GitHub Desktop.
decode.js passing encoding option to request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This answer is wrong, see https://gist.github.com/papascott/d81264223a5d492af040ea6f0277e041 | |
| const Iconv = require("iconv").Iconv; | |
| const request = require("request"); | |
| const urlTestFeed = "https://www.presseportal.de/rss/dienststelle_110972.rss2"; | |
| request({ | |
| uri: urlTestFeed, | |
| encoding: "latin1" | |
| }, | |
| function (err, response, theString) { | |
| var iconv = new Iconv("ISO-8859-1", "UTF-8"); | |
| var newString = iconv.convert(theString).toString(); | |
| console.log(theString); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment