Convert a few code snippets.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-07-18 07:04:17 +00:00
parent 810a202d80
commit 023b9cec66
3 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
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)...
# ...display text...