title: Non-ascii characters while using http and urllib modules in python3
body: <pre><code>import http.client, urllib.request, urllib.parse, urllib.error
  
  def translate(IN, OUT, text):
      text = urllib.parse.quote(text)
      conn = http.client.HTTPConnection("translate.google.com.tr")
      conn.request("GET", "/translate_a/t?client=t&amp;text="+text+"&amp;hl="+IN+"&amp;tl="+OUT)
      res = conn.getresponse().read().decode("cp1254",'replace')
      print(res)
      b1 = res.split("],[")
      b2 = b1[0].strip('[]')
      b3 = b2.strip('","')
      b4 = b3.split('","')
      return b4[0]
  
  string = input("Turkish &gt;&gt;&gt; English: ")
  result = translate("tr","en",string)
  print(string,"&gt;&gt;&gt;",result)
  </code></pre>
  
  <p>im trying to write a script which can translate Turkish into English. That script works well if i dont type Turkish character. For example these Turkish words translated successfully = (kalemlik,deneme,bilgisayar,okyanus) but if the word i typed has a non-ascii character then translate is unsuccessful. These are Turkish characters = ("ıİğĞüÜşŞöÖçÇ") and these are some Turkish words have a non-ascii character = (programcı,şarkı,çalışma,örnek,İnsan,dağ,üs). By the way , cp1254 is valid encoding for Turkish characters.
  What can i do for solve this problem? You know, it isnt for only Turkish.</p>
  
  <p>Examples;</p>
  
  <pre><code>Turkish &gt;&gt;&gt; English: okyanus
  [[["ocean","okyanus","",""]],[["isim",["ocean","brine","the deep","main","drink"],[["ocean",["okyanus","derya"]],["brine",["tuzlu su","salamura","deniz","okyanus"]],["the deep",["deniz","okyanus","enginler"]],["main",["ana boru","deniz","kuvvet","zor","okyanus","horoz dövüşü"]],["drink",["içmek","içki","içecek","içki içmek","deniz","okyanus"]]]],["sıfat",["oceanic"],[["oceanic",["okyanus","okyanusta bulunan","okyanus gibi"]]]]],"tr",,[["ocean",[5],1,0,999,0,1,0]],[["okyanus",4,,,""],["okyanus",5,[["ocean",999,1,0],["oceanic",0,1,0],["the ocean",0,1,0],["oceans",0,1,0]],[[0,7]],"okyanus"]],,,[["tr"]],2]
  okyanus &gt;&gt;&gt; ocean
  </code></pre>
  
  <p>That was successful.</p>
  
  <pre><code>    Turkish &gt;&gt;&gt; English: dağ
  [[["daÄ\u0178","daÄ\u0178","",""]],,"tr",,[["daÄ\u0178",[5],1,0,1000,0,1,0]],[["daÄ\u0178",5,[["daÄ\u0178",1000,1,0]],[[0,4]],"daÄ\u0178"]],,,[["tr"]],8]
  dağ &gt;&gt;&gt; daÄ\u0178
  </code></pre>
  
  <p>Fail!</p>