Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/FontMapper.1.py

14 lines
498 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...