I'm scraping the web using a node wrapper for the Bing API.
I print the text data from the results and I get some weird boxes with question marks inside of them. I've tried using escape and decodeURIComponent, but it's not getting rid of the symbols. What sort of encoding knowledge should I know to fix this?
Asked
Active
Viewed 98 times
0

Laurel
- 5,965
- 14
- 31
- 57

CuriousFellow
- 225
- 1
- 3
- 14
-
1Probably UTF-8 encoding – Starfish May 15 '16 at 01:53
-
@Patrick2607 so I need to encode it to UTF-8? – CuriousFellow May 15 '16 at 01:56
-
You can always try – Starfish May 15 '16 at 01:56
1 Answers
0
I decided to use regex pattern to replace anything not in the ascii char range (0-127).
x = x.replace(/[^\x00-\x7F]/g, "");

CuriousFellow
- 225
- 1
- 3
- 14