Using GWT Listbox with Unicode
In our new project remotespots.com, we use GWT for the front end. Since remotespots supports two languages (English & Turkish), with a listbox we enables users to select which language they are going to use.
GWT’s Listbox is a combo box basically. GWT support HTML in most of its widgets, but this is not the case for ListBox. You can only add String instances to a listbox.
This cause problems with characters which are non-english like ö ü ç
In such a case, to overcome the problem, unicode representation should be used.
ListBox lb = new ListBox();
lb.addItem("English", "en");
lb.addItem("T\u00FBrk\u00E7e", "tr");
The full list of the unicode representations, this link can be used. (http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/TURKISH.TXT)






I set utf8 as the encoding of my site and of the java file that includes the ListBox. Everything works fine now. No need for the “T\u00FBrk\u00E7e” kung-foo.
Thanks Kerem, that works perfectly! Still there is hidden pleasure doing things the hard way… No I am just kidding