Just a quick question about these two versions of wxPython. If I don't
purposely take advantage of the Unicode features of the Unicode build of
wxPython, does that mean that my program will run the same with either
version?
Not necessarily. It doesn't take too much work to inadvertantly paste a
unicode character into some control from some other unicode-enabled
application (like your web browser, email client, etc.). On a unicode
build, that character will look as you expect it to, and will work just
fine. That is, until you try to save the content of that control to
disk. Then you get to have fun with the wonderful world of encodings.
Using an ANSI build, you'll probably either not be able to paste that
bit of unicode text, or when you do, any non-ascii characters will
probably be displayed as a garbage character of some kind (I've noticed
boxes generally). On the upside, you also won't need to bother with
encodings when trying to save data.
Either way, you may need to deal with encodings when *reading* data from
disk, if that data can come from disparate sources with/without
encodings, etc.
I guess another way to ask it is, if I build a program with the ANSI
version of wxPython, does that hinder it in any way even if I'm not
trying to do anything special with Unicode characters?
It depends.
In other words, to put it yet another way, is Unicode something you must
use explicitly in order to get any use out of the Unicode build,
otherwise they are the same?
If your software is open source, there are good odds that some
non-english-speaking user is going to pick it up and try to use it.
They will be putting in characters from their language, and if/when it
doesn't work, you will get a "please add unicode support" request.
I'm just trying to figure out which version I really need. I figure
since I even have to ask the question, I could probably settle for ANSI,
but I want to make sure that this doesn't handcuff me later, such as
when I might want to switch to the Unicode version.
As long as you are explicitly handling saving/loading in an
encoding-aware way, ANSI may be sufficient (don't load non-ascii files).
Earlier versions of PyPE didn't support unicode, saving, or loading with
a particular encoding. I eventually got a feature request, and added
the necessary support that is only run in Unicode builds. The current
version includes detection of encoding for Python coding: directives,
XML encoding declarations, and BOMs. If you download the source version,
it can be seen in pype.py:PythonSTC.SetText and GetText .
Depending on what you plan to do with the content, and/or/if you plan on
having any sort of persistance, you may need to deal with unicode and
encodings.
- Josiah
···
John Salerno <johnjsal@NOSPAMgmail.com> wrote: