Reputation: 11384
I am using the UIBinder in GWT but I have problems displaying letters with an accent.
My xml looks like this
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
...
<g:Label ui:field="lbl"></Label>
If I type my text directly in the xml <g:Label>éç</g:Label>
the accents come out fine. But if I use the setText method in the associated class lbl.setText("éç")
they are replaced by a diamond with a question mark in it.
Edit: If if type them in html it displays the ampersand and stuff
SOLUTION:
In fact when I tested the app after changing the file format to UTF-8 I hadn't went back through the code to retype all the accent which were broken during the change. So they still appeared the same in the browser.
Upvotes: 1
Views: 2288
Reputation: 12630
After doing BalusC tasks check your File Save Option go to >> 'File\AdvancedSaveOptions...' and check if your page saved as Unicode (UTF-8 with signature) codepage 650001.
Your issue may be because of using Windows Codepage 1252
just note that you have to retype your Unicode String
Upvotes: -1
Reputation: 1109875
You need to set the response encoding and client encoding to UTF-8 as well.
Add this to top of your page to instruct the XML parser to use UTF-8:
<?xml version="1.0" encoding="UTF-8"?>
Add this to the HTML <head>
to instruct the client to use UTF-8:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
Upvotes: 3