title: URI must be ascii only
body: <p>I'm creating a scraping program using Ruby</p>
  
  <p>I will ask a question because a program that used to work without problems has stopped working.</p>
  
  <p>When reading Japanese
  The error that appears is the title error</p>
  
  <pre><code>`split': URI must be ascii only "https://www.google.com/complete/search?h1=ja&amp;output=toolbar&amp;q=\u4FDD\u967A" (URI::InvalidURIError)
  </code></pre>
  
  <p>as a place to wake up</p>
  
  <pre><code>doc = REXML::Document.new(open(url).read.encode("UTF-8"))
  </code></pre>
  
  <p>here is the code</p>
  
  <p>I think it is necessary to change the URI encoding to ASCII.
  I don’t know the best way to do it.</p>
  
  <p>info</p>
  
  <pre><code>$ ruby -v
  ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]
  </code></pre>
  
  <p>Thanks</p>