Archive for the ‘JavaScript’ Category

GWT - Unicode Characters

Wednesday, December 2nd, 2009

Sometimes simple 1 minute tasks make you stop and spend 20 minutes figuring solution out.

I’ve got a request to replace the label “Up” by this arrow “▲” . What could be simpler? I quickly replaced “Up” by “▲” in my Java source code. Then I tried to save my code and got the Eclipse error “Some characters cannot be mapped using “Cp1252″ character encoding”…

The solution is simple. I used a nice online converter http://people.w3.org/rishida/scripts/uniview/conversion.php to get the Unicode code for the arrow character and then pasted it in my Java code like this:

String upArrrow = “\u25B2″;

-=Oleg=-