Invalid control character char 30262

36 views
Skip to first unread message

Chi Tak Lam

unread,
Nov 9, 2013, 10:44:53 AM11/9/13
to django...@googlegroups.com
Hi,

I have a django-celery task to retrieve data from a third party service and store into my database.
But I found an error in my log file, which is
    None: Invalid control character at: line 1134 column 14 (char 30262)

Not sure what is char 30262, maybe this?
http://www.fileformat.info/info/unicode/char/30262/index.htm

My question is, how can i solve this problem without skip this records?

Thanks.

Chi Tak Lam

unread,
Nov 11, 2013, 8:38:26 AM11/11/13
to django...@googlegroups.com
Is there anyone can help?

I think i should do a str.replace(old, new)?
but i not sure what i should i set for 'old' and 'new' argument...

something like this?
"my text".replace(char 30262, '???')

Sandro Dutra

unread,
Nov 11, 2013, 8:50:21 AM11/11/13
to django...@googlegroups.com
Try to write on top of this file:

# -*- coding: utf-8 -*-

Maybe help.


2013/11/11 Chi Tak Lam <cta...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cc611f7e-ea7a-4ac6-827e-da1bef990387%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Timothy W. Cook

unread,
Nov 11, 2013, 10:46:58 AM11/11/13
to django...@googlegroups.com
The replace was my thought as well. I would just replace it with an
empty string. Especially since it is a control character and apprently
doesn't carry human readable information.

?????
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cc611f7e-ea7a-4ac6-827e-da1bef990387%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

m1chael

unread,
Nov 11, 2013, 1:05:53 PM11/11/13
to django...@googlegroups.com

I use ignore in unicode(...) to solve annoying things like this

Chi Tak Lam

unread,
Nov 20, 2013, 9:37:25 AM11/20/13
to django...@googlegroups.com

I end up fix the problem by just passing strict=false to json.loads()...
json.loads(response.read(), strict=False).

The error didn't occur anymore, seem like working fine.

Thanks



On Saturday, November 9, 2013 11:44:53 PM UTC+8, Chi Tak Lam wrote:
Reply all
Reply to author
Forward
0 new messages