oXygen changes file enconding when saving
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 33
- Joined: Wed Oct 04, 2006 6:25 pm
oXygen changes file enconding when saving
Hi,
I am editing a file which is encoded in UCS-2 Little Endian. After editing it, it doesn't work anymore, and I noticed that it might be due to the fact that oXygen changes the encoding to UTF-8 without BOM when saving the file.
This is the default behaviour, because I haven't changed any settings yet. I find it very inconvenient.
I've got two questions:
- a) What is this configured this way?
- b) How can I change that behaviour so that the enconding of the file is not changed? I've checked the preferences but I'm not sure what option might do this.
I hope someone can give me some hint. Thanks a lot!
Cheers, Manuel
I am editing a file which is encoded in UCS-2 Little Endian. After editing it, it doesn't work anymore, and I noticed that it might be due to the fact that oXygen changes the encoding to UTF-8 without BOM when saving the file.
This is the default behaviour, because I haven't changed any settings yet. I find it very inconvenient.
I've got two questions:
- a) What is this configured this way?
- b) How can I change that behaviour so that the enconding of the file is not changed? I've checked the preferences but I'm not sure what option might do this.
I hope someone can give me some hint. Thanks a lot!

Cheers, Manuel
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: oXygen changes file enconding when saving
Hello,
If it's an XML file then Oxygen uses the encoding mentioned in the XML declaration from the XML file.
e.g.
The BOM is also considered, but you should make sure that the BOM and encoding from the XML declaration don't contradict each other.
Details on how Oxygen handles encodings when opening a file can be found here:
http://www.oxygenxml.com/doc/ug-oxygen/ ... ments.html
Note however, UCS-2 is not in the list of encodings supported by Oxygen. The best you can do is open it in Oxygen as UTF-16(which supersedes UCS-2) but I'm not sure if it will be decoded properly. Obviously you won't be able to save it back to UCS-2 since it's not supported. Again, the closest you can get is to use UTF-16.
Regards,
Adrian
If it's an XML file then Oxygen uses the encoding mentioned in the XML declaration from the XML file.
e.g.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
Details on how Oxygen handles encodings when opening a file can be found here:
http://www.oxygenxml.com/doc/ug-oxygen/ ... ments.html
Note however, UCS-2 is not in the list of encodings supported by Oxygen. The best you can do is open it in Oxygen as UTF-16(which supersedes UCS-2) but I'm not sure if it will be decoded properly. Obviously you won't be able to save it back to UCS-2 since it's not supported. Again, the closest you can get is to use UTF-16.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 33
- Joined: Wed Oct 04, 2006 6:25 pm
Re: oXygen changes file enconding when saving
Hi Adrian,
Thank you very much for your reply!
My XML file's declaration is simply:
I thought UCS-2 and UTF-16 were the same thing, but it seems they're not. Well, what you explains why the encoding is changed:
The file command in cygwin only says the file is "XML document text" regardless of its encoding. I could see the encoding changed opening the file in Notepad++ before and after saving in with oXygen (I don't know whether oXygen has any similar function).
One the other hand, the documentation page you suggested says:
How can I instruct oXygen to use a particular code chart when loading the file or when saving it?
Deeply grateful for your help,
Manuel
Thank you very much for your reply!
My XML file's declaration is simply:
Code: Select all
<?xml version="1.0"?>
I noticed that oXygen changed something because the file didn't work anymore after saving, and because its size was reduced to its half (from 8Mb to 4Mb).UCS-2 is not in the list of encodings supported by Oxygen. (...) you won't be able to save it back to UCS-2 since it's not supported.
The file command in cygwin only says the file is "XML document text" regardless of its encoding. I could see the encoding changed opening the file in Notepad++ before and after saving in with oXygen (I don't know whether oXygen has any similar function).
One the other hand, the documentation page you suggested says:
but that doesn't happen in my case, the file is saved in my new encoding without prompting any dialog.When the encoding type cannot be determined, Oxygen prompts and display the Available Java Encodings dialog which provides a list of all encodings supported by the Java platform.
How can I instruct oXygen to use a particular code chart when loading the file or when saving it?
Deeply grateful for your help,
Manuel
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygen changes file enconding when saving
Post by sorin_ristache »
Oxygen displays the dialog with all available encodings on the computer only on opening the document, when the encoding cannot be detected from the encoding declaration and/or BOM. Once the document is opened in an editor panel, the encoding of the file was already determined and will be applied when saving the document without displaying again the dialog with available encodings.xinelo wrote:One the other hand, the documentation page you suggested says:but that doesn't happen in my case, the file is saved in my new encoding without prompting any dialog.When the encoding type cannot be determined, Oxygen prompts and display the Available Java Encodings dialog which provides a list of all encodings supported by the Java platform.
With the encoding declaration at the beginning of the file, that is by starting the file withxinelo wrote:How can I instruct oXygen to use a particular code chart when loading the file or when saving it?
Code: Select all
<?xml version="1.0" encoding="UTF-16"?>
Code: Select all
<?xml version="1.0"?>
Regards,
Sorin
-
- Posts: 33
- Joined: Wed Oct 04, 2006 6:25 pm
Re: oXygen changes file enconding when saving
In my case, the first time I open the file, oXygen prompts me to choose one from the list of available editors, so as to associate my user-defined extension with the file type. However, I don't have a choice about the encoding.
I'll check whether I can add the encoding to the declaration. It seems the files work after adding UTF-16. If I open the file and change the declaration to
and then save, it seems the encoding is not changed. So it looks fine.
Thanks a lot, Sorin and Adrian.
Manuel
I'll check whether I can add the encoding to the declaration. It seems the files work after adding UTF-16. If I open the file and change the declaration to
Code: Select all
<?xml version="1.0" encoding="UTF-16"?>
Thanks a lot, Sorin and Adrian.
Manuel
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service