Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

UnicodeDecodeError in Django

i am having this issue: even if i added # -*- coding: utf-8 -*- on the top of my views.py, i am getting UnicodeDecodeError. how can i handle those german umlauts ü,ö,ä in my views? i am trying to send emails with german umlauts in its content.

please help me with this issue. i want that german umlauts are shown correctly in its original form. i can write ä like ae, but this is what i want to avoid.

i googled a lot, but couldnot find anything that helped me

ERROR:
UnicodeDecodeError at /location-save/ ('ascii', ' kannst Du \n diese Location einsehen. M\xc3\xb6glichkeiten zur Bearbeitung der Locations werden bald zur Verfuegung stehen. \n\n Herzliche Gruesse, \n Dein LocateYourDate Team', 55, 56, 'ordinal not in range(128)')

The string that could not be encoded/decoded was: en. M��glic

Answer*

Draft saved
Draft discarded
Cancel
3
  • thanks, please see my error message update in the question. what should i do now? Commented Apr 1, 2013 at 5:09
  • @doniyor: Well, you need to understand how Unicode works in Python, to be honest. So you need to read the documentation and maybe some helpful blogposts. Start with these two: regebro.wordpress.com/2011/03/23/… farmdev.com/talks/unicode Commented Apr 1, 2013 at 5:13
  • very nice. great help. honestly, i am very lazy to read about encodings :( Commented Apr 1, 2013 at 5:18

lang-py

AltStyle によって変換されたページ (->オリジナル) /