Files
Metallicow 1257f42189 ⁉️ Trim trailing whitespace docs/sphinx/rest_substitutions/*.py
⁉️ Not sure if the generated .rst stuff is intended to have
whitespace like this in it or not, so seperating this from the other
commits, so easy to revert if necessary.
2018-01-16 09:02:20 -06:00

14 lines
478 B
Python

if not wx.FontMapper.Get().IsEncodingAvailable(enc, facename):
success, alt = wx.FontMapper.Get().GetAltForEncoding(enc, facename, False)
if success:
convFrom = wx.FontMapper.Get().GetEncodingName(enc)
convTo = wx.FontMapper.Get().GetEncodingName(alt)
text = text.decode(convFrom).encode(convTo)
else:
# ...failure (or we may try iso8859-1/7bit ASCII)...
pass
# ...display text...