File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -73,3 +73,10 @@ def is_us(s):
7373 return isinstance (s , str )
7474 else :
7575 return isinstance (s , str ) or isinstance (s , unicode )
76+
77+ def uchr (c ):
78+ """Return the Unicode string containing the given character."""
79+ if _py3 :
80+ return chr (c )
81+ else :
82+ return unichr (c )
Original file line number Diff line number Diff line change 4949from email .MIMEMultipart import MIMEMultipart
5050import roundup .anypy .email_
5151
52+ from roundup .anypy .strings import uchr
53+
5254def initialiseSecurity (security ):
5355 '''Create some Permissions and Roles on the security object
5456
@@ -778,7 +780,7 @@ def _decode_charref(matchobj):
778780 uc = int (num [1 :], 16 )
779781 else :
780782 uc = int (num )
781- return unichr (uc )
783+ return uchr (uc )
782784
783785 for field_name in self .form :
784786 field = self .form [field_name ]
Original file line number Diff line number Diff line change 11
22from __future__ import print_function
3- from roundup .anypy .strings import u2s
3+ from roundup .anypy .strings import u2s , uchr
44class dehtml :
55 def __init__ (self , converter ):
66 if converter == "none" :
@@ -70,7 +70,7 @@ def handle_endtag(self, tag):
7070 def handle_entityref (self , name ):
7171 if self ._skip_data :
7272 return
73- c = unichr (name2codepoint [name ])
73+ c = uchr (name2codepoint [name ])
7474 try :
7575 self .text = self .text + c
7676 except UnicodeEncodeError :
You can’t perform that action at this time.
0 commit comments