Bad encoding of JavaScript files
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 19
- Joined: Thu Feb 09, 2012 3:52 pm
Bad encoding of JavaScript files
Hello,
We've noticed that Oxygen causes our Cp1521-encoded JavaScript files to be displayed (and encoded) badly, always to UTF-8. Removing Oxygen from our plugins resolves the issue and displays JavaScript files correctly again.
All JavaScript editors are affected, including the normal text editor and the WTP JavaScript editor. It seems to be a setting for the general .js content type. I couldn't find such a setting in the preferences, though.
It seems as though Eclipse thinks that the JavaScript content is actually encoded that way. Everytime we save such a file, the actual encoding will be overwritten:

We've noticed that Oxygen causes our Cp1521-encoded JavaScript files to be displayed (and encoded) badly, always to UTF-8. Removing Oxygen from our plugins resolves the issue and displays JavaScript files correctly again.
All JavaScript editors are affected, including the normal text editor and the WTP JavaScript editor. It seems to be a setting for the general .js content type. I couldn't find such a setting in the preferences, though.
It seems as though Eclipse thinks that the JavaScript content is actually encoded that way. Everytime we save such a file, the actual encoding will be overwritten:

-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Bad encoding of JavaScript files
Hello,
I have logged this problem to our issue tracking tool and we will investigate. We will notify you when a new version with the bugfix becomes available.
Meanwhile, you can easily get rid of this problem by editing the plugin.xml file from the Oxygen plugin directory and removing the oXygen JavaScript content type extension point.
If you have used the Eclipse update site, the Oxygen plugin folder is:
"<eclipse>/plugins/com.oxygenxml.editor_VV.V.0.vXXXXXXXXXX".
If you have used the zip distribution the plugin folder is located in:
"<eclipse>/dropins/com.oxygenxml.editor_VV.V.0.vXXXXXXXXXX/plugins/com.oxygenxml.editor_VV.V.0.vXXXXXXXXXX"
VV.V is the version and XXXXXXXXXX is the build number.
Edit the plugin.xml file and remove this section(search for "JsFile"):
Afterwards, make sure you run Eclipse at least once with the -clean command line argument.
e.g. eclipse.exe -clean
Regards,
Adrian
I have logged this problem to our issue tracking tool and we will investigate. We will notify you when a new version with the bugfix becomes available.
Meanwhile, you can easily get rid of this problem by editing the plugin.xml file from the Oxygen plugin directory and removing the oXygen JavaScript content type extension point.
If you have used the Eclipse update site, the Oxygen plugin folder is:
"<eclipse>/plugins/com.oxygenxml.editor_VV.V.0.vXXXXXXXXXX".
If you have used the zip distribution the plugin folder is located in:
"<eclipse>/dropins/com.oxygenxml.editor_VV.V.0.vXXXXXXXXXX/plugins/com.oxygenxml.editor_VV.V.0.vXXXXXXXXXX"
VV.V is the version and XXXXXXXXXX is the build number.
Edit the plugin.xml file and remove this section(search for "JsFile"):
Code: Select all
<extension point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.core.runtime.text"
priority="low"
file-extensions="js"
id="JsFile"
name="oXygen JavaScript">
<describer class="com.oxygenxml.editor.editors.xml.XMLContentDescriber"/>
</content-type>
</extension>
e.g. eclipse.exe -clean
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: 19
- Joined: Thu Feb 09, 2012 3:52 pm
Re: Bad encoding of JavaScript files
Note, in our distribution, the JsFile describer is actually a UTF8ContentDescriber:
Maybe that's the problem?
Code: Select all
<extension point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.core.runtime.text"
priority="low"
file-extensions="js"
id="JsFile"
name="oXygen JavaScript">
<describer class="com.oxygenxml.editor.editors.UTF8ContentDescriber"/>
</content-type>
</extension>
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Bad encoding of JavaScript files
The UTF8ContentDescriber was changed to XMLContentDescriber for all three types of files(CSS, JS, and JSON) in the latest maintenance build of Oxygen v13.2, 2012040515.
Update to the latest maintenance build and check if it makes any difference. Note that you will have to patch the plugin.xml again in case it doesn't.
You can download it here:
http://www.oxygenxml.com/download_oxyge ... os=Eclipse
or if you are using the Eclipse update site, you can simply update the plugin from Eclipse:
Help > Check for Updates
Let me know if it makes any difference.
Regards,
Adrian
Update to the latest maintenance build and check if it makes any difference. Note that you will have to patch the plugin.xml again in case it doesn't.
You can download it here:
http://www.oxygenxml.com/download_oxyge ... os=Eclipse
or if you are using the Eclipse update site, you can simply update the plugin from Eclipse:
Help > Check for Updates
Let me know if it makes any difference.
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: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Bad encoding of JavaScript files
Hi,
I'd just like to point out that even with the latest build, the Oxygen content describer will force the UTF-8 encoding for .js files when it can. It can do this if the files do not contain characters outside of the range of the UTF-8 encoding. This usually happens for all newly created .js files.
So, if you want to keep your chosen encoding(Cp1521) for all .js files(new or old), I still recommend editing the plugin.xml file and removing that section.
Regards,
Adrian
I'd just like to point out that even with the latest build, the Oxygen content describer will force the UTF-8 encoding for .js files when it can. It can do this if the files do not contain characters outside of the range of the UTF-8 encoding. This usually happens for all newly created .js files.
So, if you want to keep your chosen encoding(Cp1521) for all .js files(new or old), I still recommend editing the plugin.xml file and removing that section.
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
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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