X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b519803b436486ca933d750c990ef64a29551221..11ec0dcea243f7ce1cbe7d33bfd9cd0e2f6d9083:/wxPython/src/msw/_core.py diff --git a/wxPython/src/msw/_core.py b/wxPython/src/msw/_core.py index ae05c5f67d..f3eef317dd 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_core.py @@ -5174,6 +5174,24 @@ def GetApp(*args, **kwargs): Return a reference to the current wx.App object. """ return _core_.GetApp(*args, **kwargs) + +def SetDefaultPyEncoding(*args, **kwargs): + """ + SetDefaultPyEncoding(string encoding) + + Sets the encoding that wxPython will use when it needs to convert a + Python string or unicode object to or from a wxString. + """ + return _core_.SetDefaultPyEncoding(*args, **kwargs) + +def GetDefaultPyEncoding(*args, **kwargs): + """ + GetDefaultPyEncoding() -> string + + Gets the current encoding that wxPython will use when it needs to + convert a Python string or unicode object to or from a wxString. + """ + return _core_.GetDefaultPyEncoding(*args, **kwargs) #---------------------------------------------------------------------- class PyOnDemandOutputWindow: @@ -10841,6 +10859,16 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION: #---------------------------------------------------------------------------- +# Set the default string conversion encoding from the locale +import locale +default = locale.getdefaultlocale()[1] +if default: + wx.SetDefaultPyEncoding(default) +del default +del locale + +#---------------------------------------------------------------------------- + class PyDeadObjectError(AttributeError): pass