RosettaCodeData/Task/String-length/Python/string-length-8.py

6 lines
141 B
Python

# The letter Alef
print(len('\u05d0'.encode())) # the default encoding is utf-8 in Python3
# 2
print(len('\u05d0'.encode('iso-8859-8')))
# 1