[ create a new paste ] login | about

Project: apertium
Link: http://apertium.codepad.org/8EQ0gUNh    [ raw code | fork ]

unhammer - Python, pasted on Apr 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

decodehtmlentities='#!/usr/bin/env python2
import sys, codecs
sys.stdin = codecs.getreader("utf-8")(sys.stdin)
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
sys.stderr = codecs.getwriter("utf-8")(sys.stderr)

import HTMLParser
h = HTMLParser.HTMLParser()

for line in sys.stdin:
print h.unescape(line),'

uconv -f utf-8 -t utf-8 --callback escape-xml-dec | python2 -c "$decodehtmlentities"


Create a new paste based on this one


Comments: