Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
print len('ascii')
# 5

View file

@ -0,0 +1,2 @@
print(len("𝔘𝔫𝔦𝔠𝔬𝔡𝔢"))
# 7

View file

@ -0,0 +1,2 @@
import sys
sys.maxunicode # 1114111 on a wide build, 65535 on a narrow build

View file

@ -0,0 +1,4 @@
print(len('ascii'))
# 5
print(len('\u05d0')) # the letter Alef as unicode literal
# 1

View file

@ -0,0 +1,2 @@
print(len(b'\xd7\x90'.decode('utf-8'))) # Alef encoded as utf-8 byte sequence
# 1

View file

@ -0,0 +1,2 @@
print(hex(sys.maxunicode), len(unichr(0x1F4A9)))
# ('0x10ffff', 1)

View file

@ -0,0 +1,2 @@
print(hex(sys.maxunicode), len(unichr(0x1F4A9)))
# ('0xffff', 2)

View file

@ -0,0 +1,5 @@
# The letter Alef
print len(u'\u05d0'.encode('utf-8'))
# 2
print len(u'\u05d0'.encode('iso-8859-8'))
# 1

View file

@ -0,0 +1,6 @@
#!/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-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).

View file

@ -0,0 +1,2 @@
import sys
sys.maxunicode # 1114111 on a wide build, 65535 on a narrow build

View file

@ -0,0 +1,8 @@
print len('ascii')
# 5
print len(u'\u05d0') # the letter Alef as unicode literal
# 1
print len('\xd7\x90'.decode('utf-8')) # Same encoded as utf-8 string
# 1
print hex(sys.maxunicode), len(unichr(0x1F4A9))
# ('0x10ffff', 1)

View file

@ -0,0 +1,2 @@
print hex(sys.maxunicode), len(unichr(0x1F4A9))
# ('0xffff', 2)

View file

@ -0,0 +1,2 @@
print(len(b'Hello, World!'))
# 13

View file

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

View 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