Well,

I appliy it to sitecustomize.py like below:

import sys
sys.setdefaultencoding('euc-kr')

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

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

after:
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.

in
 /usr/local//lib/python2.6/dist-packages/Django-1.3-py2.6.egg/django/
core/handlers/base.py

class BaseHandler(object):

   def get_response(self, request):

# I think here is that function.

try:
             # 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 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to