~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to wxPython/wx/tools/Editra/src/ebmlib/txtutil.py

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-07 13:59:25 UTC
  • mfrom: (1.1.9) (5.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120107135925-2601miy9ullcon9j
Tags: 2.8.12.1-6ubuntu1
* Resync from Debian, changes that were kept:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control: Build-dep on libxt-dev for mediactrl.
  - Patches
    + fix-bashism-in-example
* Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to python-wxversion
  to guarantee upgrade ordering when moving from pycentral to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
"""
15
15
 
16
16
__author__ = "Cody Precord <cprecord@editra.org>"
17
 
__svnid__ = "$Id: txtutil.py 62571 2009-11-08 17:53:27Z CJP $"
18
 
__revision__ = "$Revision: 62571 $"
 
17
__svnid__ = "$Id: txtutil.py 67991 2011-06-20 23:48:01Z CJP $"
 
18
__revision__ = "$Revision: 67991 $"
19
19
 
20
 
__all__ = [ 'IsUnicode', ]
 
20
__all__ = [ 'IsUnicode', 'DecodeString']
21
21
 
22
22
#-----------------------------------------------------------------------------#
23
23
# Imports
32
32
 
33
33
    """
34
34
    return isinstance(txt, types.UnicodeType)
 
35
 
 
36
def DecodeString(txt, enc):
 
37
    """Decode the given string with the given encoding,
 
38
    only attempts to decode if the given txt is not already Unicode
 
39
    @param txt: string
 
40
    @param enc: encoding 'utf-8'
 
41
    @return: unicode
 
42
 
 
43
    """
 
44
    if IsUnicode(txt):
 
45
        txt = txt.decode(enc)
 
46
    return txt