01-19-2009 01:00 PM
I do not recommend to rely on particular strings in menu items into your code.
What if your application is going to be localized to another language?
What if a customer or you will want to rename/redesign menu item ?
It will lead you to rewrite the logic. It may (and will) produce additional bugs into your code and it is not a good programming style.
Analyze conditions which lead to show certain menu items and act accordingly, but do not build the application logic on language specific strings comparison.
01-19-2009 06:57 PM
Makes a lot of sense, thanks... in my case I've tried various alternatives without much luck, and am aware of the drawbacks.
Thanks a ton for your time on this issue!
01-20-2009 04:39 AM
01-22-2009 10:33 AM
01-24-2009 01:16 PM
Thanks for supplying this example. In my test changing the locale did not have any effect on the presence of the control character in the string; I guess that would be expected.
I've gone ahead and changed my code to ignore the control characters and just grab what I need. Thanks to everyone for their help on this.