Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/String-length/Python/string-length-9.py
Normal file
9
Task/String-length/Python/string-length-9.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/env python
|
||||
# -*- coding: UTF-8 -*-
|
||||
s = "møøse"
|
||||
assert len(s) == 5
|
||||
assert len(s.encode('UTF-8')) == 7
|
||||
assert len(s.encode('UTF-16-BE')) == 10 # There are 3 different UTF-16 encodings: LE and BE are little endian and big endian respectively, the third one (without suffix) adds 2 extra leading bytes: the byte-order mark (BOM).
|
||||
u="𝔘𝔫𝔦𝔠𝔬𝔡𝔢"
|
||||
assert len(u.encode()) == 28
|
||||
assert len(u.encode('UTF-16-BE')) == 28
|
||||
Loading…
Add table
Add a link
Reference in a new issue