Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Default text file encoding & utf-8
Default text file encoding & utf-8 [message #327595] Fri, 25 April 2008 13:21 Go to next message
Eclipse UserFriend
Originally posted by: j4r0d.hotmail.com

Hello,

I have created a plugin and I am able to export it. My problem at the moment
is that I can't find a way to change the default value for text file
encoding for my exported plugin. I know how to do that under Eclipse, but I
would like to change it in the eclipse configuration file.
I have tried things like this in my plugin_customization.ini:

org.eclipse.ui/org.eclipse.ui.edit.text.encoding=utf-8

Without success.. even modifying eclipse.ini directly was not a great help.
Do you have an idea about how to do that?

Thanks,

--
J.
Re: Default text file encoding & utf-8 [message #327597 is a reply to message #327595] Fri, 25 April 2008 13:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jarod,

I wonder if it's influenced by the file.encoding or os.encoding VM
properties? I don't think it makes sense that a specific plugin should
be able to change the system default. This is after all a user
preference for their workspace...

Jarod Mills wrote:
> Hello,
>
> I have created a plugin and I am able to export it. My problem at the moment
> is that I can't find a way to change the default value for text file
> encoding for my exported plugin. I know how to do that under Eclipse, but I
> would like to change it in the eclipse configuration file.
> I have tried things like this in my plugin_customization.ini:
>
> org.eclipse.ui/org.eclipse.ui.edit.text.encoding=utf-8
>
> Without success.. even modifying eclipse.ini directly was not a great help.
> Do you have an idea about how to do that?
>
> Thanks,
>
>
Re: Default text file encoding & utf-8 [message #327603 is a reply to message #327597] Fri, 25 April 2008 15:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: j4r0d.hotmail.com

Ed,

I don't want to force the user to use utf-8. I would just really appreciate
if default setting could be utf-8 rather than Cp1252. No matter if the user
changes this parameter later. This default configuration is just a part of a
language support system in my plugin. Keeping the default Cp1252 is a source
of errors anytime the user forgets to set this parameter. I don't want my
plugin to be responsible for that change (okay then,
plugin_customisation.ini was definitely not a good idea), the freshly
exported eclipse should have the utf-8 as the default parameter for file
encoding.
There is no way I can do that?

--
J.


> Jarod,
>
> I wonder if it's influenced by the file.encoding or os.encoding VM
> properties? I don't think it makes sense that a specific plugin should be
> able to change the system default. This is after all a user preference
> for their workspace...
>
> Jarod Mills wrote:
>> Hello,
>>
>> I have created a plugin and I am able to export it. My problem at the
>> moment is that I can't find a way to change the default value for text
>> file encoding for my exported plugin. I know how to do that under
>> Eclipse, but I would like to change it in the eclipse configuration file.
>> I have tried things like this in my plugin_customization.ini:
>>
>> org.eclipse.ui/org.eclipse.ui.edit.text.encoding=utf-8
>>
>> Without success.. even modifying eclipse.ini directly was not a great
>> help.
>> Do you have an idea about how to do that?
>>
>> Thanks,
>>
>>
Re: Default text file encoding & utf-8 [message #327605 is a reply to message #327603] Fri, 25 April 2008 16:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

Jarod Mills wrote:
> Ed,
>
> I don't want to force the user to use utf-8. I would just really appreciate
> if default setting could be utf-8 rather than Cp1252. No matter if the user
> changes this parameter later. This default configuration is just a part of a
> language support system in my plugin. Keeping the default Cp1252 is a source
> of errors anytime the user forgets to set this parameter. I don't want my
> plugin to be responsible for that change (okay then,
> plugin_customisation.ini was definitely not a good idea), the freshly
> exported eclipse should have the utf-8 as the default parameter for file
> encoding.
> There is no way I can do that?
>
Create a plugin_customization.ini and put the following line into it:

org.eclipse.core.resources/encoding=UTF-8

--
Derek
Re: Default text file encoding & utf-8 [message #327607 is a reply to message #327603] Fri, 25 April 2008 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jarod,

Comments below.


Jarod Mills wrote:
> Ed,
>
> I don't want to force the user to use utf-8. I would just really appreciate
> if default setting could be utf-8 rather than Cp1252.
What exactly is the default setting you're referring to here? The
platform has a default setting, but you don't want to change that, so
what default are you wanting to change?
> No matter if the user
> changes this parameter later. This default configuration is just a part of a
> language support system in my plugin.
So you have a preference or setting somewhere? I don't understand...
> Keeping the default Cp1252 is a source
> of errors anytime the user forgets to set this parameter.
Now we're talking about the user again... :-(
> I don't want my
> plugin to be responsible for that change (okay then,
> plugin_customisation.ini was definitely not a good idea), the freshly
> exported eclipse should have the utf-8 as the default parameter for file
> encoding.
> There is no way I can do that?
>
Perhaps your plugin is creating new files and you want those new files
to be UTF-8 encoded? You can use File.setCharset to do that...
Re: Default text file encoding & utf-8 [message #327611 is a reply to message #327607] Fri, 25 April 2008 16:56 Go to previous message
Eclipse UserFriend
Originally posted by: j4r0d.hotmail.com

Ed,

Sorry for not being clear enough. Derek has found a working solution, and I
thank him for this.

Remaining comments below.



>> I don't want to force the user to use utf-8. I would just really
>> appreciate if default setting could be utf-8 rather than Cp1252.
> What exactly is the default setting you're referring to here? The
> platform has a default setting, but you don't want to change that, so what
> default are you wanting to change?

In fact, I was referring to what I can see in the Window > Preferences >
General > Workspace then Text file encoding. I believe this is the default
setting for the platform.
I need this setting in order to have support for utf-8 (as you can imagine).

>> No matter if the user changes this parameter later. This default
>> configuration is just a part of a language support system in my plugin.
> So you have a preference or setting somewhere? I don't understand...

Not exactly, I mean the text file encoding is necessary for my xml file (the
editor input) to generate some java code (with utf-8 encoding).

>> Keeping the default Cp1252 is a source of errors anytime the user forgets
>> to set this parameter.
> Now we're talking about the user again... :-(

The generated code itself is not the problem, but when the user run this
java code, special characters are not handled.

>> I don't want my plugin to be responsible for that change (okay then,
>> plugin_customisation.ini was definitely not a good idea), the freshly
>> exported eclipse should have the utf-8 as the default parameter for file
>> encoding.
>> There is no way I can do that?
>>
> Perhaps your plugin is creating new files and you want those new files to
> be UTF-8 encoded? You can use File.setCharset to do that...

This may be a more elegant solution. I will consider that Ed. Thanks for
your help.
Previous Topic:Two IPropertySources for MultipageEditor
Next Topic:Refreshing Table in Property Section (Property View)
Goto Forum:
  


Current Time: Fri Jul 12 09:52:48 GMT 2024

Powered by FUDForum. Page generated in 0.04438 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top