RosettaCodeData/Task/String-length/Python/string-length-1.py
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

6 lines
223 B
Python

#!/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).