Javascript file contents displayed as Chinese?!

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jakob
Posts: 3
Joined: Thu Sep 02, 2010 11:12 pm

Javascript file contents displayed as Chinese?!

Post by jakob »

Hi,

using OxygenXML 11.2 on MacOS X, I've noticed that sometimes Javascript files are displayed as garbage. To better illustrate the problem see here:

http://imagebin.ca/view/mJC4DaQ1.html

I should add that all files are managed by Subversion (on a Windows server), so maybe it has something to do with line endings?

Another case was when I downloaded a Javascript file that was UTF-8 and tried opening it with OxygenXML. I actually had to cut the contents and paste it in a new file that I created with OxygenXML.

If it helps, I can also provide the source code files.

Thanks for your help (in the meantime, I'll be using Dashcode or TextEdit :( ),
Jakob.
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Javascript file contents displayed as Chinese?!

Post by adrian »

Hello,

This looks like an encoding problem.
Look in Options -> Preferences -> Encoding at the option "Encoding for non XML files". Oxygen uses the encoding specified here for all non-XML files(JavaScript included) without detecting the encoding of the file.
Change this option to UTF8 and try to reopen the file in Oxygen.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
jakob
Posts: 3
Joined: Thu Sep 02, 2010 11:12 pm

Re: Javascript file contents displayed as Chinese?!

Post by jakob »

Thanks Adrian, I did what you suggested and it works. Thanks a lot! What's the difference between Unicode (the previous setting) and UTF-8?

Jakob.
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Javascript file contents displayed as Chinese?!

Post by adrian »

The two mentioned encodings don't have much in common:
http://www.ingrid.org/java/i18n/encoding/table.html (look at the end)

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply