xsd text garbled on upgrade of oxygen and eclipse

Having trouble installing Oxygen? Got a bug to report? Post it all here.
bwinspur
Posts: 37
Joined: Tue Nov 25, 2003 3:31 am

xsd text garbled on upgrade of oxygen and eclipse

Post by bwinspur »

I have been using oxygen 2.0.4 on eclipse 2.x and am migrating to oxygen 4.2_e3. I'm running XP Pro.

PROBLEM: an xsd file developed under 2.0.4 shows up as garbage
in the editor pane under 4.2_e3. It looks like an encoding incompatibility.

I was able to work around it by opening the xsd file in jedit; copying the text to the clipboard and, pasting the text into the editor window. That worked until I closed and re-opened eclipse, when the xsd file again showed up as garbled, and attempting to open the file in jedit produced the diagnostic:

'Cannot load with "Unicode" encoding. (sun.io.MalformedInputException: Missing byte-order mark)
The encoding can be changed in the Commands menu of the file system browser.

QUESTION: What steps should I take to resolve this problem and to rescue my now inaccessible xsd file?

Thanks,
Bill W.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Bill,

Can you send over a sample file that has this problem at support@oxygenxml.com ? That will help us understand what happens.

A possible workaround will be to edit specify UTF-8 as the file encoding. Oxygen should work without problems with this.

Best Regards,
George
bwinspur
Posts: 37
Joined: Tue Nov 25, 2003 3:31 am

re: xsd text garbled on upgrade of oxygen and eclipse

Post by bwinspur »

Further info. I tried using Eclipse's edit|encoding menu option to set the encoding to UTF-8, but it had no apparent effect.
Bill W.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Bill,

Just to have the discussion updated also here.

--
Thank you for sending the file.
The file actual encoding is UTF-8 but it contains UTF-16 in the XML header
and this confuses oXygen as it reads the header and uses UTF-16 further. Now I tried to reproduce this with oXygen 2.0.4 but it saves the xml files that specify UTF-16 in the XML header correctly so I do not understand how you end up with this file. The solution will be to specify UTF-8 in the file
header instead of UTF-16 in an editor that shows correclty the file content,
for instance you can do this in oXygen after you paste the content from
JEdit.
--

Best regards,
George
bwinspur
Posts: 37
Joined: Tue Nov 25, 2003 3:31 am

Post by bwinspur »

Thanks George,

We're OK now. after the following steps:
1. Select and delete the garbage source in the oxygen edit pane.
2. Paste the correct source into the oxygen edit pane.
3. Change line 1 from
<?xml version="1.0" encoding="UTF-16"?> to
<?xml version="1.0" encoding="UTF-8"?>
4. Saved the file

After this it closed and opened normally.

Bill.
Bill W.
Post Reply