Ticket #766: AddComment-utf8.patch

File AddComment-utf8.patch, 1.1 kB (added by tonin, 2 years ago)

UTF-8 patch

  • AddComment.py

    old new  
    1616       raise TracError('\'AddComment\' macro cannot be included twice') 
    1717    hdf['addcommentmacro'] = True 
    1818 
    19     authname = hdf.getValue("trac.authname", "anonymous") 
     19    authname = hdf.getValue("trac.authname", "anonymous").decode('utf-8') 
    2020    db = env.get_db_cnx() 
    2121    perm = trac.perm.PermissionCache(env, authname) 
    2222    pagename = hdf.getValue("wiki.page_name", "WikiStart") 
     
    3535 
    3636    disabled = '' 
    3737 
    38     comment = Markup(hdf.getValue("args.addcomment", "")).unescape() 
     38    comment = Markup(hdf.getValue("args.addcomment", "").decode('utf-8')).unescape() 
    3939    preview = hdf.getValue("args.previewaddcomment", "") 
    4040    cancel = hdf.getValue("args.canceladdcomment", "") 
    4141    submit = hdf.getValue("args.submitaddcomment", "") 
    4242    if not cancel: 
    43         authname = hdf.getValue("args.authoraddcomment", authname) 
     43        authname = hdf.getValue("args.authoraddcomment", authname).decode('utf-8') 
    4444 
    4545    # Ensure [[AddComment]] is not present in comment, so that infinite 
    4646    # recursion does not occur.