Default text file encoding & utf-8 [message #327595] |
Fri, 25 April 2008 09:21  |
Eclipse User |
|
|
|
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 #327611 is a reply to message #327607] |
Fri, 25 April 2008 12:56  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.06861 seconds