Hello,
I think there is a problem with files containing
ISO-8859-1 accents.
I have written a tiny file that Butterfly cant load:
<?xml version="1.0" encoding="ISO-8859-1"?><foo>é</foo>
This sample file has been written with plain old vim
editor, and are successfully parsed by libxml, Mozilla
and Java_1.5
Trying to open this file always produces a
NullPointerException :
29 Oct 2004 16:31:24,803 DEBUG -
OpenAction.actionPerformed() (butterfly.actions.OpenAction)
29 Oct 2004 16:31:24,804 DEBUG - component lookup
is:butterfly.xmlview.ButterflyApplication@c39a20
(butterfly.actions.OpenAction)
29 Oct 2004 16:31:24,804 DEBUG - looking up the
content handler for the file extension: .xml
(butterfly.actions.OpenAction)
29 Oct 2004 16:31:24,804 DEBUG - content handler for
type:.xml
is:butterfly.actions.contenthandlers.XmlContentHandler@bb05de
(butterfly.actions.contenthandlers.ContentHandlerLookup)
29 Oct 2004 16:31:24,804 DEBUG - looking in the cache
for:/w/archix/fiches/truc.xml
(butterfly.actions.OpenAction)
29 Oct 2004 16:31:24,804 DEBUG - is new file=false
(butterfly.actions.OpenAction)
java.lang.NullPointerException
at
org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown
Source)
at org.apache.xerces.impl.io.UTF8Reader.read(Unknown
Source)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at
java.io.BufferedReader.readLine(BufferedReader.java:299)
at
java.io.BufferedReader.readLine(BufferedReader.java:362)
at
butterfly.xmlview.io.XmlViewFileSystem.readFile(XmlViewFileSystem.java:141)
at
butterfly.actions.contenthandlers.AbstractContentHandler.loadDocument(AbstractContentHandler.java:84)
at
butterfly.actions.OpenAction.actionPerformed(OpenAction.java:157)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at
java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at
java.awt.Component.dispatchEventImpl(Component.java:3615)
at
java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at
java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
29 Oct 2004 16:31:24,808 WARN -
java.lang.NullPointerException
(butterfly.actions.OpenAction)
For your information, these files cant be loaded by
butterfly either:
<?xml version="1.0" encoding="UTF-8"?><foo>é</foo>
<?xml version="1.0"?><foo>é</foo>
Logged In: NO
If you use the unicode escape é it'll display fine in
Firefox for instance and load too. But, you should handle
the conversion behind the scenes. i.e. if you paste an
accented character and save, it should convert to the escape
in the file, and when you load it should just be displayed
as the accent (though you'd probably want an option to turn
the auto changing on and off (for those that like to edit
escape codes manually))