I appliy it to sitecustomize.py like below:

import sys

Then, my reviewboard's error message is changed. Only that.

JSONEncoderAdapter.encode: Arguments are:  {'stat': 'ok',
'review_request': <ReviewRequest: [Bad Unicode data]>}

JSONEncoderAdapter.encode: Arguments are:  {'stat': 'ok',
'review_request': <ReviewRequest: test ㅏㅁ너아ㅏㅓ test>}

actually, there's no korean, but weird sign in <ReviewRequest: ...>

And, I try to find response data when rb request to perforce.


class BaseHandler(object):

   def get_response(self, request):

# I think here is that function.

             # Apply response middleware, regardless of the response
             for middleware_method in self._response_middleware:
                 response = middleware_method(request, response)

The exception is occurred in this sentence.

But, I cannot trace more.

I need someone's help.

Thank you.

On 4월9일, 오전1시02분, Chris Clark <chris.cl...@ingres.com> wrote:
> jh5774....@samsung.com wrote:
> > Well, I found a little clue about encoding.
> > /usr/lib/python2.6/json/__init__.py
> > in this codes, they said python only decode 'ASCII' and 'Unicode'.
> > So, python couldn't decode when encounter like a 'Korean word'
> > I find some solution about decoding.
> > For example,
> >     a= '테스트'
> >     unicodeA =a.decode('euc-kr')
> >     utf8A = unicodeA.encode('utf-8')
> > or
> >     u = unicode(a, 'euc-kr').encode('utf-8')
> > Now, I must find the where reviewboard receive response message
> > which their request to perforce using 'p4 describe' command.
> > Anyone who knows about that, please tell me.
> I'd be tempted to take a look at postreview and look at adding an
> encoding flag. I haven't yet really looked at the transport mechanism,
> there is a string implication that Unicode (specifically utf8) is sent
> for the diffs, really bytes should be sent. This may be because json is
> supposed to be utf8. Basically you would do the first part of your
> example above in postreview. The other option (and this is a hack) is to
> change your site packages to change the default system encoding for
> Python from ASCII (default for windows) to euc-kr. This normally isn't
> recommended BUT it would be a good diagnostic step to take to
> prove/disprove the theory.  
> Seehttp://blog.ianbicking.org/illusive-setdefaultencoding.html
> Let us know how you get on.
> The extreme solution would be to use utf8 encoding for all source code,
> which is fine for new projects but more tricky for older projects.

Want to help the Review Board project? Donate today at 
Happy user? Let us know at http://www.reviewboard.org/users/
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to