seancarmody / ngramr

R package to query the Google Ngram Viewer
Other
48 stars 9 forks source link

Unicode problems #10

Closed seancarmody closed 11 years ago

seancarmody commented 11 years ago

The Google Ngram Viewer allows some fancy phrases such as "fancy=>pants". In the Javascript this comes back as ''fancy\u003D\u003Epants" and so I need to convert this Unicode encoding back to ASCII. I am stumped.

seancarmody commented 11 years ago

@briatte any thoughts on this?

briatte commented 11 years ago

Yes, try this:

> iconv("fancy\u003D\u003Epants")
[1] "fancy=>pants"
seancarmody commented 11 years ago

That only works when you type the string in the console, not if it's a string obtained from Google!

I do have a fix now thanks to StackOverflow.