Jump to content

String Byte Length: Difference between revisions

(needs-review for examples identical to String Character Length)
Line 264:
>>> len(u'\u05d0'.encode('iso-8859-8'))
1
 
Example from the problem statement:
#!/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 #XXX it should be `10' as problem statement says
 
=={{header|Ruby}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.