rodazuero / gmapsdistance

Future
GNU General Public License v3.0
75 stars 40 forks source link

Report bug Input is not proper UTF-8, indicate encoding #20

Open MichalPleva opened 7 years ago

MichalPleva commented 7 years ago

Hi @rodazuero, @njanetos,

I think this issue was not solved by install.packages("devtools") because when I run: gmapsdistance(origin = "50.070708+14.468469", destination = "50.075829+14.418829", mode = "walking") it does not work, and unfortunately still shows the same error Error: 1: Input is not proper UTF-8, indicate encoding !. Could you please help me ? Thank you in advance.

rodazuero commented 7 years ago

Hi Michal, Thanks for your message and sorry about getting back to you late. I am still not sure why this error message is generated. I actually do not get an error message when I run your code. After running install.packages("devtools") you might want to install it again: devtools::install_github("rodazuero/gmapsdistance")

Let us know if this helps.

MichalPleva commented 7 years ago

Hi @rodazuero, Thanks for your advice. I ran devtools::install_github("rodazuero/gmapsdistance") and it worked, but only for "walking" mode.

When I then tried the same for "driving" mode, I've got new error mentioned in open issues: Error in rowXML[[dur]] : subscript out of bounds.

m.

rodazuero commented 7 years ago

Michal, Thanks for your message again and apologies on being late on my reply. I have not been able to replicate this error message. However, I have received a couple of mails from people with similar issues. I'm still not sure why is this the case but will work on this. Thanks for your message and I hope to fix this bug. Rodrigo

steeles0 commented 7 years ago

I am getting the same error as @MichalPleva after reinstalling this package with devtools.

aakarner commented 7 years ago

I'm getting a similar error - it appears to happen randomly. There's nothing obvious in the lat/long coordinates that should be causing this, but it happens consistently with the same pairs.

jvlegels commented 7 years ago

Not really helpful, but I'm also getting the same error.

Input is not proper UTF-8, indicate encoding ! Bytes: 0xE9 0x73 0x69 0x72 Error: 1: Input is not proper UTF-8, indicate encoding ! Bytes: 0xE9 0x73 0x69 0x72

Valkoinen17 commented 7 years ago

I suppse that the problem could lie in the actual name of the specified locations. For example: the originlocation in the code of the topicstarter is "Novorossijská 1-3, Praha 10, Czechia", according to Google Maps.

If you replace in the function gmapsdistance:

webpageXML = xmlParse(readLines(tc))

with

webpageXML = xmlParse(str_replace(readLines(tc),"á","a"))

it should be fine (at least this particular example).

Note: i used the CRAN-version of the package. Note2: str_replace comes in the stringr-package