My '&' character (from an URL) disappears (dictionary)


I’ve added a simple “history” feature in a project yesterday evening and it seems to be working offline.

Minutes ago, I check on line (with URL with ampersands: ‘&’) and they disappears.

I used a dictionary to store / restore the URLs.

I checked in the online doc and do not found anything about that.

In the mean time (if this is a bug), I will try to use an array to achieve the same function.

Try replacing the “&” by “&&”. I do not find the reference for it now but if you receive URLs from a Mac OS X method you have to double it or it will disappear (but don’t remember if this was mac-only).

It depends on where you display them, but you are right. This especially happens with labels and menus because the ampersand character is used for specifying the menu shortcut key for Windows and Linux.


IT is not a Dictionary or an Array behaviour. Read below, it have to do with the accelerator key.

Question: on Windows 8.1 and up, can you access to a PopupMenu from the keyboard if that PopupMenu cannot get te focus (will never have the focus) ?

After extensive reseach, it happens that it is the PopupMenu who eat the & (if you pass it one, you get none, if you pass it 2 you get one, and so on).

What is strange is that it is a default behavior: I get a PopupMenu and change nothing in its properties. IT DOES NOT HAVE THE FOCUS: IT NEVER RECEIVE THE FOCUS.

Because of that I consider this eating process as a bug.

Read my new report on the subject.

Not a bug. Standard behavior. The whole point of accelerator keys is the control doesn’t have to have focus.

Thanks Tim: I do not knew that.

That is why I do not found a note in the docs (PopupMenu).


I deleted the PopupMenu and now use a ListBox instead and that is good (better ?); I still have to check online but I have a good feeling on that.