FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
html5lib-python/utils/iana_parse.py at python3-old · darobin/html5lib-python · GitHub
darobin
/
html5lib-python
Public
forked from
html5lib/html5lib-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
html5lib-python
/
utils
/
iana_parse.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (22 loc) · 643 Bytes
Breadcrumbs
html5lib-python
/
utils
/
iana_parse.py
Copy path
File metadata and controls
24 lines (22 loc) · 643 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
import
sys
import
urllib2
import
codecs
def
main
():
encodings
=
[]
f
=
urllib2
.
urlopen
(
sys
.
argv
[
1
])
for
line
in
f
:
if
line
.
startswith
(
"Name: "
)
or
line
.
startswith
(
"Alias: "
):
enc
=
line
.
split
()[
1
]
try
:
codecs
.
lookup
(
enc
)
if
enc
.
lower
not
in
encodings
:
encodings
.
append
(
enc
.
lower
())
except
LookupError
:
pass
sys
.
stdout
.
write
(
"encodings = frozenset((
\n
"
)
for
enc
in
encodings
:
sys
.
stdout
.
write
(
' "%s",
\n
'
%
enc
)
sys
.
stdout
.
write
(
' ))'
)
if
__name__
==
"__main__"
:
main
()
Back
|
FazBrowse Home
|
New Git URL