I got tired of hand-formatting or shell-scripting a text converter for this blog to post code properly so I wrote this py script to do it for me. It converts a text file containing possibly used HTML characters into HTML character codes.
#!/usr/bin/python import sys s = "" l = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" while (1): c = sys.stdin.read(1) if (not c): break o = ord(c) if (o == 13): continue elif ((o < 127) and (c not in l)): s += ("&#" + str(o) + ";") else: s += (c) print(s)
[…] HTML Char Escape […]
It is not my first time to go to see this web site, i am visiting this web page dailly and get nice
facts from here every day.
[…] Projects […]