JavaScript files with UTF-8 encoding [message #205778] |
Thu, 13 December 2007 20:17 |
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 05:01 |
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 14:23 |
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.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02077 seconds