<p>The question's code won't compile due to misspellings. Even if those errors were fixed, the code doesn't do something useful - <code>xmlToList</code> is applied on the <em>URL</em>, not the results of a GET request. That's enough to generate the error :</p>

<pre><code>query&lt;-"http://export.arxiv.org/api/query?search_query=(au:( \"Benoit Bertrand\"))&amp;start=0&amp;max_results=2000"
xmlToList(query)
</code></pre>

<p>No amount of URL encoding and conversions will fix that. No conversion is needed either, since the URL falls in the US-ASCII range. In that range a UTF8 string is indistinguishable from an ASCII string. </p>

<p>The correct code to get and parse this Arxiv page is :</p>

<pre><code>//Just a URL
query&lt;-"http://export.arxiv.org/api/query?search_query=(au:( \"Benoit Bertrand\"))&amp;start=0&amp;max_results=2000"
//Get the contents
r &lt;- GET(query)
//Extract the text from the response
xml&lt;-content(r, "text")
//Read as lists
l&lt;-xmlToList(xml)
</code></pre>

<p>The response <code>r</code> isn't just a string, it's an object that contains headers (including the encoding), the response status and the response content. One of the headers is the Content-Type :</p>

<pre><code>&gt; r
Response [http://export.arxiv.org/api/query?search_query=(au:( "Benoit Bertrand"))&amp;start=0&amp;max_results=2000]
  Date: 2019-09-30 12:54
  Status: 200
  Content-Type: application/atom+xml; charset=UTF-8
  Size: 786 B
</code></pre>

<p><code>content(r, "text")</code> converts the content to text using the encoding stored in that header.</p>

<p>After that, <code>xmlToList</code> can parse the XML string </p>
R Error: 1: Input is not proper UTF-8, indicate encoding ! XMLtoList
<p>Here is my code, I have a query that I transform in UTF8 but finally I get an error that the query is not in UTF8 I don't manage to fix it:</p>

<pre><code>library("XML")
library("methods")
library("httr")

query = http://export.arxiv.org/api/query?search_query=(au:( \"Benoit Bertrand\"))&amp;start=0&amp;max_results=2000
xml_data = xmlToList(iconv(URLencode(query),to="UTF-8"))
</code></pre>

<blockquote>
  <p>Error: 1: Input is not proper UTF-8, indicate encoding !<br>
  Bytes: 0xC9 0x70 0x69 0x6A</p>
</blockquote>

<p>I find that's space character that made the code crash but that is all I got </p>