Summary: | TVT2: Mnemonic characters displayed in error message | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] PDE | Reporter: | Richard Bone <rabone> | ||||
Component: | UI | Assignee: | Wassim Melhem <wassim.melhem> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | camle, dejan, Kevin_Haaland | ||||
Version: | 2.0 | ||||||
Target Milestone: | 2.0.1 | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Richard Bone
2002-06-15 13:58:43 EDT
Created attachment 1430 [details]
Mnemonic in error message
This bug was opened in response to TPRS ID=105 PDE reuses the option label for inclusion in the error messages by stripping the mnemonic character as follows: public String getMessageLabel() { String label = getLabel(); StringBuffer buf = new StringBuffer(); for (int i = 0; i < label.length(); i++) { char c = label.charAt(i); if (c != '&' && c != ':') buf.append(c); } return buf.toString(); } Richard, do you know why this does not work for DBCS languages? Dejan, I don't see anything in that code that should be incompatible with DBCS characters. I thought there could have been a problem with the charAt function, but it appears that it should work for DBCS languages. I've verified it on the 730 integration build on a japanese machine. Do you think getMessageLabel is even being called? I see a japanese string followed by (&N) over here... please disregard my last comment... i was relying on my expert knowledge of japanese to guide me through replicating the bug again. :-) problem is, i wound up finding an unrelated (although similar looking) problem... The problem is caused by the way mnemonics are specified on DBCS locales. On SBCS locales, mnemonics are specified by simply placing '&' in front of the mnemonic character in the label: Some &Label: The code above works well with this (result is "Some Label"). On DBCS locales, labels use DBCS characters that are not suitable for mnemonics. For that reason, translated labels follow the following convention: Some Label in DBCS (&L): The result when applying the code above is "Some Label in DBCS (L)" The fix that works well is to also look for DBCS mnemonic sequence "(&" and truncate the label at that point. Using that extra check, the result is "Some Label in DBCS ". Tested and verified on Japanese locale. The fix is in HEAD. |