Useing non-ascii character in django

56 views
Skip to first unread message

Hossein Rashnoo

unread,
Nov 8, 2014, 3:19:10 AM11/8/14
to django...@googlegroups.com
When i return Persian characters in view.py (same as Arabic characters) i got an error , So i add this line to top of view.py:
# encoding=utf-8

And now my Persian word is like this :
�����
And when i add 'u' before my word again i got error,I run django on Linux with Apache. Please help me and sorry for my terrible English.  

Aliane Abdelouahab

unread,
Nov 8, 2014, 10:47:42 AM11/8/14
to django...@googlegroups.com
in your html you add 

<meta charset="UTF-8">

Aliane Abdelouahab

unread,
Nov 8, 2014, 10:48:30 AM11/8/14
to django...@googlegroups.com
and dont forget to use an font that is unicode, using CSS3.

Hossein Rashnoo

unread,
Nov 9, 2014, 4:18:16 AM11/9/14
to django...@googlegroups.com
Writing my code with linux editor cause the problem,I wrote that with notepad and save it as 'utf8' and my problem solved.
Reply all
Reply to author
Forward
0 new messages