{"action":"closed","issue":{"url":"https://api.github.com/repos/PMassicotte/gtrendsR/issues/57","labels_url":"https://api.github.com/repos/PMassicotte/gtrendsR/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/PMassicotte/gtrendsR/issues/57/comments","events_url":"https://api.github.com/repos/PMassicotte/gtrendsR/issues/57/events","html_url":"https://github.com/PMassicotte/gtrendsR/issues/57","id":128035643,"number":57,"title":"Support for UTF-8 queries (Arabic, Chinese, Japanese, Hindi, etc.)","user":{"login":"benryan58","id":9218454,"avatar_url":"https://avatars.githubusercontent.com/u/9218454?v=3","gravatar_id":"","url":"https://api.github.com/users/benryan58","html_url":"https://github.com/benryan58","followers_url":"https://api.github.com/users/benryan58/followers","following_url":"https://api.github.com/users/benryan58/following{/other_user}","gists_url":"https://api.github.com/users/benryan58/gists{/gist_id}","starred_url":"https://api.github.com/users/benryan58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benryan58/subscriptions","organizations_url":"https://api.github.com/users/benryan58/orgs","repos_url":"https://api.github.com/users/benryan58/repos","events_url":"https://api.github.com/users/benryan58/events{/privacy}","received_events_url":"https://api.github.com/users/benryan58/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-21T22:27:22Z","updated_at":"2016-01-22T12:08:56Z","closed_at":"2016-01-22T12:08:56Z","body":"Currently submitting search terms encoded in UTF-8 (if checking non-latinate language search terms) returns no results. This appears to be on account of a line in the gtrends.default function that converts latin2 queries to UTF-8 queries; queries already formatted in UTF-8 end up garbled. \r\n\r\nI suggest adding a check around that line so that if the query is already UTF-8 then the conversion doesn't happen, like so:\r\n\r\n## Change encoding to utf-8\r\nif (!(Encoding(query) == \"UTF-8\")) {\r\n  query <- iconv(query, \"latin1\", \"utf-8\", sub = \"byte\")\r\n}\r\n"}}