0

I want to use a url(http://192.xxx.x.xxx:8080/가나다.png) that contains Korean characters to show an image. The server sent me an error starting with

UnicodeEncodeError...

I tried sys.setdefaultencoding and unicode_literals, but that didn't solve the problem.

What could be the reason for this?

How can I make sure Korean characters are dealt with properly?

Using test.encode("utf-8") is not an option.

Joris Meys
  • 106,551
  • 31
  • 221
  • 263
shin
  • 11
  • 3
  • The server also has to be able to parse non-unicode characters.. one of the best reads ever about character sets: https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/ – nir0s Mar 15 '17 at 06:51
  • 2
    Add the minimum, but working sample code. – Shuo Mar 15 '17 at 06:52
  • Rephrased the question to make it more clear – Joris Meys Mar 16 '17 at 12:15
  • You do not give essential information here! How do you send the URL to the server (from Python, from a browser, other...)? What systems sends the error or where does is appear? What is the exact text of the error? Are you responsable for the client side, server side? Currently this question is off topic according the [How to ask?](http://stackoverflow.com/help/how-to-ask) – Serge Ballesta Mar 16 '17 at 12:50

0 Answers0