コード例 #1
0
ファイル: trimoptions.py プロジェクト: BenTrem/think-link
def fixstring(str):
    """remove crap characters due to interpreting utf-8 as microsoft code page"""
    str = str.replace(u"“", u'"').replace(u"’", u"'").replace(u"â€", u'"')
    str = cf.convert_entities(str)
    str = cf.convert_unicode_u(str)
    str = html_to_segments(str)
    return str.strip()
コード例 #2
0
ファイル: trimoptions.py プロジェクト: BenTrem/think-link
def fixstring(str):
	"""remove crap characters due to interpreting utf-8 as microsoft code page"""
	str = str.replace(u"“",u'"').replace(u"’",u"'").replace(u"â€",u'"')
	str = cf.convert_entities(str)
	str = cf.convert_unicode_u(str)
	str = html_to_segments(str)
	return str.strip()
コード例 #3
0
ファイル: trimoptions.py プロジェクト: BenTrem/think-link
def cleanup(claim):
    claim = cf.convert_entities(claim)
    claim = cf.convert_unicode(claim)
コード例 #4
0
def fix_string(txt):
	txt = cf.convert_entities(txt)
	txt = cf.convert_unicode(txt)
	return txt.decode('utf-8')
コード例 #5
0
ファイル: trimoptions.py プロジェクト: BenTrem/think-link
def cleanup(claim):
	claim = cf.convert_entities(claim)
	claim = cf.convert_unicode(claim)
コード例 #6
0
def fix_string(txt):
    txt = cf.convert_entities(txt)
    txt = cf.convert_unicode(txt)
    return txt.decode("utf-8")