Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JavaScript files with UTF-8 encoding
JavaScript files with UTF-8 encoding [message #205778] Thu, 13 December 2007 15:17 Go to next message
Eclipse User
Originally posted by: scott.gonzalez.gmail.com

I have Eclipse setup to use UTF-8 for text files (in the General ->
Workspace settings). However, it views all .js files as ISO-8859-1.

If I create a new text file, then check the properties from the Navigation
tab (right click on the file in Navigation and choose "Properties" from
the menu), in the "Text file encoding" frame it says "Default (inherited
from container: UTF-8)", which is what I would expect. However, if I then
change the extension of the file to .js and repeat the steps, the encoding
now say "Default (determined from content: ISO-8859-1)".

I can manually change it to UTF-8. When I try to apply this setting, I
get a warning that says, "UTF-8 conflicts with the encoding defined in the
content type (ISO-8859-1). Do you wish to set it anyways?" If I click
yes, it will properly treat the file as UTF-8.

Does anyone why Eclipse considers all .js files to be encoded as
ISO-8859-1?

I'm using Eclipse 3.2.2 on Windows XP.
Re: JavaScript files with UTF-8 encoding [message #205803 is a reply to message #205778] Fri, 14 December 2007 00:01 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

You need to go to Preferences->Editor->Content-Type->Text->Javascript
and change the content type for *.js from ISO-8859-1 to UTF-8.

Dave


> I can manually change it to UTF-8. When I try to apply this setting, I
> get a warning that says, "UTF-8 conflicts with the encoding defined in
> the content type (ISO-8859-1). Do you wish to set it anyways?" If I
> click yes, it will properly treat the file as UTF-8.
>
> Does anyone why Eclipse considers all .js files to be encoded as
> ISO-8859-1?
>
Re: JavaScript files with UTF-8 encoding [message #205850 is a reply to message #205803] Fri, 14 December 2007 09:23 Go to previous messageGo to next message
Eclipse User
Originally posted by: scott.gonzalez.gmail.com

Thanks, that works.


David Carver wrote:

> You need to go to Preferences->Editor->Content-Type->Text->Javascript
> and change the content type for *.js from ISO-8859-1 to UTF-8.
Re: JavaScript files with UTF-8 encoding [message #205866 is a reply to message #205803] Fri, 14 December 2007 12:05 Go to previous message
Christian Müller is currently offline Christian Müller
Messages: 9
Registered: July 2009
Junior Member
David Carver schrieb:
> You need to go to Preferences->Editor->Content-Type->Text->Javascript
> and change the content type for *.js from ISO-8859-1 to UTF-8.

In addition to that.

- Having specified a charset with a Context-Type forces this
charset on all an every File.
- Leaving the charset blank, makes the editor to adhere to
project-/container-settings

--
Chris
Previous Topic:WSDL validation: help please.
Next Topic:AXIS java client to consume .NET web services
Goto Forum:
  


Current Time: Fri Aug 01 22:37:50 EDT 2014

Powered by FUDForum. Page generated in 0.01520 seconds