#2845: post-commit hook & unicode
-------------------------------------+--------------------------------------
 Reporter:  [EMAIL PROTECTED]  |        Owner:  jonas
     Type:  task                     |       Status:  new  
 Priority:  highest                  |    Milestone:       
Component:  ticket system            |      Version:  0.9.4
 Severity:  normal                   |   Resolution:       
 Keywords:                           |  
-------------------------------------+--------------------------------------
Comment (by anonymous):

 Solution that works for me is:

  1. Use standard redirect to file (no unicode) which will save file in
 windows current code page.[[br]][[br]]
  2. find the code in trac-post-commit-hook in lines 136,137:

 {{{
         msg = self._readFromFile( msg )
         self.msg = "(In [%s]) %s" % (rev, msg)
 }}}

 and replace it with

 {{{
         ##
         ## International character support
         ##
         #  decode message from user locale encodeing,
         #  to get codepagefor windows from command prompt run command chcp
         dec_msg = msg.decode('cp852')

         #  encode it to unicode, because trac must use unicode to
 represent
         #  international characters
         uni_msg = dec_msg.encode('utf-8')

         self.msg = "(In [%s]) %s" % (rev, uni_msg)
 }}}
 ''''''

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/2845>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets

Reply via email to