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

7 lines
223 B
Python
Raw Normal View History

2013-04-11 01:07:29 -07:00
#!/bin/env python
# -*- coding: UTF-8 -*-
s = u"møøse"
assert len(s) == 5
assert len(s.encode('UTF-8')) == 7
assert len(s.encode('UTF-16')) == 12 # The extra character is probably a leading Unicode byte-order mark (BOM).