Hello everybody,
I'm using the GridPanel and it works very well as long as I do not use
certain words including mutated vowels (e.g. ü,ä,ö). The grid's store
is filled with JSON data sent by an HttpProxy. I guess, this is an
encoding problem.
I spent some hours with asking google, but couldn't find a working
solution.
My question: How can I influence the encoding and decoding of a JSON-
string used to fill a store?
/************The PROBLEM*****************/
The problem (see stack trace) occures only in the internet explorer 7
(and gwt hosted mode), not in firefox 3:
Creation of JSON-Data:
JSONObject o = new JSONObject();
o.put("totalCount", dataObjects.size());
for(DataObject r : dataObjects){
JSONObject values = new JSONObject();
values.put("id", r.getId());
values.put("valueA", r.getValueA());
values.put("valueB", r.getValueB());
o.append("rows", values);
}
Value A and ValueB should be Strings. They come from a mysql database
(using utf-8). In a ComboBox they are displayed correctly in all
cases. In Firefox, the vowels are not displayed correctly, but at
least all JSON data is parsed and displayed.
.
The following values of ValueB lead to a view in the IE, the JSON is
parsed:
- "Fahrvergünstigung" => is displayed as Fahrverg[]ung ([] is one
character)
- "Kuriergepäck" => is displayed as Kuriergep[]
- "Reisebünstro" => is displayed as Reiseb[]
Interestingly ValueA sometimes contains "Fahrvergünstigung" and other
strings with "ü" but this also doesn't lead to errors. (Nevertheless
the mutated vowels are displayed as [] and some following characters
are missing)
The following values of ValueB lead to an error (see exception) in the
IE, so the JSON is not parsed:
- "Reisebüro"
- "ü"
Stack-Trace of GWT-Hosted-Mode:
[ERROR] An error was encountered loading the store
com.gwtext.client.data.StoreLoadException: Expected '}'
at com.gwtext.client.data.Store.createStoreLoadException(Store.java:
907)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:
103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod
(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke
(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke
(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6
(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6
(COMObject.java:117)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at com.google.gwt.dev.SwtHostedModeBase.processEvents
(SwtHostedModeBase.java:235)
at com.google.gwt.dev.HostedModeBase.pumpEventLoop
(HostedModeBase.java:558)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
/****What I tried, but DIDN'T WORK******/
- I set the encoding of my code-files to utf-8
- I used URI.create(string).toASCIIString() but this was neither by ff
nor by ie displayed correctly (I see only rubbish at the place where
the vowel should be)
A workaround would be to change "ü" to "ue" etc. But this is no
alternative for me.
By the way, I am using gwtext 2.0.2.
How can I solve this problem?
I hope you can help me. I'm curious for your suggestions :)
Stefanie
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---