django
- 07/01/2010
[Quickie] Django - Forcing the encoding of strings
I had problems with accented strings coming from a webservice. Everything was working perfectly!! minus the accents in words ...
I searched for a long time in oracle and I could not make it work. I replaced an idea with @ kplaube and he gave me this tip.
To force the encoding of a string use in Django:
- , strings_only= False , errors= 'replace' ) force_unicode (s, encoding = 'utf-8', strings_only = False, errors = 'replace')
Done it all worked chubby!
Ref: # http://docs.djangoproject.com/en/dev/ref/unicode/ useful-utility-functions
Credits: @ kplaube




4 Responses to "[Quickie] Django - Forcing the encoding of strings"
Hey doctor, dropped the PHP time?
're Already addicted to python, or going back?
hug,
For diego (15 comments) on 07.01.2010
I left nothing heehhe
I love PHP yet, but as I'm having a legal contact with Python / Django I'll post some things related
A big hug!
For Marcelo Sabadini (112 comments) on 08.01.2010
Oops, this tip is good. Do not know
Thanks Marcelo
By Francisco Souza (3 comments) on 23/01/2010
That broke a galhão heheheheh
For Marcelo Sabadini (112 comments) on 28.01.2010