Changeset 2432

Show
Ignore:
Timestamp:
07/09/07 10:35:01 (1 year ago)
Author:
bewst
Message:

TracForgePlugin:

fix unicode encoding problem. Some work yet remains.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tracforgeplugin/branches/bewst/0.11-clearsilver/tracforge/admin/dispatch.py

    r2381 r2432  
    7777        # the original stream has already been read once. 
    7878        if environ['wsgi.input']: 
    79             data = urllib.urlencode(req.args)  
     79            args = {}  
     80            for k,v in req.args.iteritems(): 
     81                if isinstance(v, unicode): 
     82                    v = v.encode('utf-8') 
     83                args[k] = v 
     84            data = urllib.urlencode(args)  
    8085            class InputStream: 
    8186                def __init__(self, data): 
     
    8792                 
    8893            environ['wsgi.input'] = InputStream(data) 
     94            # This doesn't match up sometimes. Don't know why yet. 
     95            environ['CONTENT_LENGTH'] = len(data) 
    8996 
    9097        req._response = dispatch_request(environ, start_response)