Bug 307158 DBCS3.6: DBCS names are broken in Web Browser preference after Eclipse restart.
Build Identifier: I20100313-1044 DBCS names are broken in Web Browser preference after Eclipse restart. The broken DBCS must be the characters out of the default code page, such as U+20B9F, U+309A against Shift-JIS. This bug happens only under Windows 7, XP and so on. It does not happen under SLES11(linux). Reproducible: Always Steps to Reproduce: 1.Select [Window] -> [Preferences] -> [General] -> [Web Browser] 2.Click [New] and type U+20B9F U+30AB U+309A in the name field 3.Type a browser location and click OK 4.You may see the correct name (in figure1.jpg attached in this report.) 5.Restart Eclipse. 6.Select [Window] -> [Preferences] -> [General] -> [Web Browser] 7.You may see the broken name (in figure2.jpg attached in this report.)
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/BrowserManager.java
if (currentBrowser == null && browsers.size() > 0)
			currentBrowser = (IBrowserDescriptor) browsers.get(0);
		setChanged();
		notifyObservers();
	}
	protected void saveBrowsers() {
		try {
			ignorePreferenceChanges = true;
			XMLMemento memento = XMLMemento.createWriteRoot("web-browsers"); 
			Iterator iterator = browsers.iterator();
			while (iterator.hasNext()) {
				Object obj = iterator.next();
				if (obj instanceof BrowserDescriptor) {
					BrowserDescriptor browser = (BrowserDescriptor) obj;
					IMemento child = memento.createChild("external"); 
					browser.save(child);
				} else if (obj instanceof SystemBrowserDescriptor) {
					memento.createChild("system"); 
				}
			}
			
			memento.putInteger("current", browsers.indexOf(currentBrowser)); 
			StringWriter writer = new StringWriter();
			memento.save(writer);
			String xmlString = writer.getBuffer().toString();
			InstanceScope instanceScope = new InstanceScope();
		    IEclipsePreferences prefs = instanceScope.getNode(WebBrowserUIPlugin.PLUGIN_ID);
			prefs.put("browsers", xmlString); 
			prefs.flush();