Greg and everyone:<br><br>These days I am trying to make all of my programs super-portable -- CPython2.x, IronPython and Python3 on Windows and Linux. 2/3 of these use ONLY unicode strings. One of my reasons for migrating to PyGUI is because there are no plans for wxPython to run on any platform other than 2.x. I am guessing that PyGUI, being more simple, is going to be much easier to convert to the other compilers than its competition.<br>
<br> What I am getting at is this advice from a very old programmer... try to make everything work correctly with unicode. It will make life much easier when conversion time comes around. When you do need byte strings, use a user-written function to produce them, not a built in. This is one that I have found useful:<br>
v v v v<br>def str2bytes(sval):<br> if sys.version_info < (3,0) and isinstance(sval, str):<br> sval = sval.decode("latin1")<br> return sval.encode("latin1")<br>^ ^ ^ ^<br> --<br>Vernon Cole<br>
<br><br><div class="gmail_quote">On Sat, Dec 19, 2009 at 8:04 PM, Greg Ewing <span dir="ltr"><<a href="mailto:greg.ewing@canterbury.ac.nz" target="_blank">greg.ewing@canterbury.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dan Villiom Podlaski Christiansen wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm seeing a weird issue; for some reason ‘Open as…’ and ‘Save as…’<br>
</blockquote>
> create a menu item per character in their name.<br>
<br>
Sounds like it thinks they're menu item groups instead of<br>
single items.<br>
<br>
Are these perhaps unicode strings? In Generic/GMenus.py,<br>
Menu._make_item(), there's the following piece of code:<br>
<br>
if isinstance(text, str):<br>
return SingleMenuItem(text, cmd, substitutions)<br>
else:<br>
return MenuItemGroup(text, cmd)<br>
<br>
This could get confused if it's given a unicode string<br>
instead of a plain str. It should probably be amended to<br>
take unicode into account.<br><font color="#888888">
<br>
-- <br>
Greg<br>
_______________________________________________<br>
Pygui mailing list<br>
<a href="mailto:Pygui@python.org" target="_blank">Pygui@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pygui" target="_blank">http://mail.python.org/mailman/listinfo/pygui</a><br>
</font></blockquote></div><br>