Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Editor using UTF-8
Editor using UTF-8 [message #506594] Fri, 08 January 2010 09:17 Go to next message
Jehuty is currently offline JehutyFriend
Messages: 3
Registered: November 2009
Junior Member
Hello,

I'm working on an Eclipse plugin which provides an Editor. The Editor use by default MacRoman encoding (I'm working on mac OS).

I would use UTF-8 on all platform.

I tried to add this method in my Editor:

protected void installEncodingSupport() {
	fEncodingSupport= new DefaultEncodingSupport();
	fEncodingSupport.initialize(this);
	fEncodingSupport.setEncoding("UTF-8");
}


But I have this error :

Quote:
Warning: Detected recursive attempt by part fr.loria.talaris.xulEditor to create itself (this is probably, but not necessarily, a bug)


How can I do to use UTF-8 without throw this exception?

Regards,
Jehuty
Re: Editor using UTF-8 [message #506596 is a reply to message #506594] Fri, 08 January 2010 04:34 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Jehuty wrote:
> Hello,
>
> I'm working on an Eclipse plugin which provides an Editor. The Editor
> use by default MacRoman encoding (I'm working on mac OS).
You shouldn't hack the concrete encoding into your editor. The file
should decide which encoding it has. If you a TextFileDocumentProvider
which is backed by file buffers then you get all this for free.

Dani
>
> I would use UTF-8 on all platform.
>
> I tried to add this method in my Editor:
>
> protected void installEncodingSupport() {
> fEncodingSupport= new DefaultEncodingSupport();
> fEncodingSupport.initialize(this);
> fEncodingSupport.setEncoding("UTF-8");
> }
>
> But I have this error :
>
> Quote:
>> Warning: Detected recursive attempt by part
>> fr.loria.talaris.xulEditor to create itself (this is probably, but
>> not necessarily, a bug)
>
>
> How can I do to use UTF-8 without throw this exception?
>
> Regards,
> Jehuty
Re: Editor using UTF-8 [message #506603 is a reply to message #506594] Fri, 08 January 2010 09:59 Go to previous messageGo to next message
Jehuty is currently offline JehutyFriend
Messages: 3
Registered: November 2009
Junior Member
Thank you for your reply.

In my editor class I can get the IDocument which is the file.
Can I get a TextFileDocumentProvider from this IDocument?

I never used TextFileDocumentProvider I don't know how to use it.
I'm searching.
Re: Editor using UTF-8 [message #506616 is a reply to message #506603] Fri, 08 January 2010 10:47 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Jehuty wrote:
> Thank you for your reply.
>
> In my editor class I can get the IDocument which is the file.
> Can I get a TextFileDocumentProvider from this IDocument?
Read the Javadoc.

Dani
>
> I never used TextFileDocumentProvider I don't know how to use it. I'm
> searching.
Previous Topic:Defnitions for menu actions in "Project" menu
Next Topic:Set Custom Marker on ClassFile
Goto Forum:
  


Current Time: Thu Apr 25 12:03:58 GMT 2024

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

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

Back to the top