MyEclipse: How to use encodings other than UTF-8 with Matisse?

ehodges - Aug 26, 2011 - 04:25 PM
Post subject: How to use encodings other than UTF-8 with Matisse?
I have to make some forms with non-English characters. I can manually edit the encoding field in the .form file to something like "Cp1252". That lets me use non-English characters on the form, but when I edit the form it resets the encoding to "UTF-8". I don't see any way to tell Matisse to stop doing that.

How do I make Matisse use the "Cp1252" encoding for its .form file?
support-swapna - Aug 29, 2011 - 12:18 PM
Post subject:
ehodges,

Sorry that you are seeing this issue with MyEclipse.

Can you answer some more questions for me to understand the issue better ?

1) Can you share your Build Id from Help > MyEclipse Enterprise Workbench > Build Id ? Paste the Build Id here.

2) The default encoding standard for Matisse is "Cp1252".How are you editing the encoding field ? Can you give us detail steps for me to be able to replicate it at my end ?
ehodges - Aug 31, 2011 - 03:35 PM
Post subject:
The build ID: Build id: 8.6.1-20101117

To edit a form, I right click on the .form file in the Package Explorer and Open With "MyEclipse Matisse Form editor".
ehodges - Aug 31, 2011 - 08:37 PM
Post subject:
More info:

When I create a new form, the encoding field in the .form file is "UTF-8", like this:

<?xml version="1.0" encoding="UTF-8" ?>

With that encoding, if I use non-UTF8 characters in the labels, I get an exception when I open the Matisse editor:

com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:674)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:398)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1064)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:974)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1539)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1316)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at org.openide.xml.XMLUtil.parse(XMLUtil.java:42)
at com.genuitec.eclipse.dehory.util.DehoryXMLUtil.parse(DehoryXMLUtil.java:33)
at org.netbeans.modules.form.GandalfPersistenceManager.canLoadForm(GandalfPersistenceManager.java:257)
at org.netbeans.modules.form.FormEditor.recognizeForm(FormEditor.java:431)
at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:298)
at org.netbeans.modules.form.FormEditor.loadFormDesigner(FormEditor.java:225)
at org.netbeans.modules.form.FormDesigner.componentShowing(FormDesigner.java:1788)
at com.genuitec.eclipse.dehory.DeHoryFormEditor$SwingFormEditorControl.afterComponentCreatedAWTThread(DeHoryFormEditor.java:176)
at org.eclipse.albireo.core.SwingControl$9.run(SwingControl.java:343)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


I can manually edit that encoding to "Cp1252" (by opening the form in text edit mode) so it looks like this:

<?xml version="1.0" encoding="Cp1252" ?>

That let's me edit the form with the Matisse editor, but when I save it it converts the encoding back to UTF-8 and replaces the Cp1252 characters with Numeric Character References like "&#xe9;".
support-swapna - Sep 05, 2011 - 11:04 AM
Post subject:
ehodges,

I could replicate the issue at my end. I have raised a PR for the dev team to work on it.
Sorry for the inconvenience caused.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits