Skip to content

Commit a8666f6

Browse files
committed
Added a unicode_char alias for (uni)chr
Python 2&3 compatible way to create a unicode character from an integer
1 parent 1a28fbf commit a8666f6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

javaobj/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def log_error(message, ident=0):
7373

7474
if sys.version_info[0] >= 3:
7575
UNICODE_TYPE = str
76+
unicode_char = chr
7677

7778
# Python 3 interpreter : bytes & str
7879
def to_bytes(data, encoding="UTF-8"):
@@ -118,6 +119,7 @@ def read_to_str(data):
118119

119120
else:
120121
UNICODE_TYPE = unicode
122+
unicode_char = unichr
121123

122124
# Python 2 interpreter : str & unicode
123125
def to_str(data, encoding="UTF-8"):

0 commit comments

Comments
 (0)