]> git.saurik.com Git - wxWidgets.git/commitdiff
Docs for [GS]etDefaultPyEncoding
authorRobin Dunn <robin@alldunn.com>
Tue, 28 Dec 2004 21:16:50 +0000 (21:16 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 28 Dec 2004 21:16:50 +0000 (21:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/docs/CHANGES.txt
wxPython/src/_app.i
wxPython/src/_core_ex.py

index aa4dead247c58e046c8374f2e691e3f0a1c8c50c..862685247644316830ed5df9df54fda027bad1af 100644 (file)
@@ -133,6 +133,18 @@ morbidly curious, here are a few more details:
       value using str() or to the long integer value of the pointer
       using long().
 
       value using str() or to the long integer value of the pointer
       using long().
 
+Added SetDefaultPyEncoding and GetDefaultPyEncoding functions which
+will set/get the encoding used by wxPython to convert string or
+unicode objects to/from wxString objects.  Previously the default
+Python encoding was always used, but unless the user had tweaked their
+sitecustomize.py file it is always "ascii", which would result in
+errors if the strings contained character codes >= 128.
+SetDefaultPyEncoding will now allow you to control which encoding will
+be used to do those conversions.  The default encoding is set to the
+value of `locale.getdefaultlocale()[1]` when wxPython is first
+imported.  Please see http://www.alanwood.net/demos/charsetdiffs.html
+for subtle differences between the common latin/roman encodings.
+
 
 
 
 
 
 
index 3285fef3db12fb1590df3d361660b2f6cab3fcf4..5628f0242b7aa4fe619e51c4c77a777c19c5425b 100644 (file)
@@ -361,7 +361,13 @@ DocDeclAStr(
     void , wxSetDefaultPyEncoding(const char* encoding),
     "SetDefaultPyEncoding(string encoding)",
     "Sets the encoding that wxPython will use when it needs to convert a
     void , wxSetDefaultPyEncoding(const char* encoding),
     "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.", "");
+Python string or unicode object to or from a wxString.
+
+The default encoding is the value of ``locale.getdefaultlocale()[1]``
+but please be aware that the default encoding within the same locale
+may be slightly different on different platforms.  For example, please
+see http://www.alanwood.net/demos/charsetdiffs.html for differences
+between the common latin/roman encodings.", "");
 
 DocDeclAStr(
     const char* , wxGetDefaultPyEncoding(),
 
 DocDeclAStr(
     const char* , wxGetDefaultPyEncoding(),
index 702e04f6eea88ab0dcbfd77fc00bc06efff0a3c0..656a54a9913e4ef20db88e6f697540609b2adf48 100644 (file)
@@ -32,7 +32,13 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
 
 #----------------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------------
 
-# Set the default string conversion encoding from the locale
+# Set the default string<-->unicode conversion encoding from the
+# locale.  This encoding is used when string or unicode objects need
+# to be converted in order to pass them to wxWidgets.  Please be aware
+# that the default encoding within the same locale may be slightly
+# different on different platforms.  For example, please see
+# http://www.alanwood.net/demos/charsetdiffs.html for differences
+# between the common latin/roman encodings.
 import locale
 default = locale.getdefaultlocale()[1]
 if default:
 import locale
 default = locale.getdefaultlocale()[1]
 if default: