Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Encoding issues when initializing a Text Editor
Encoding issues when initializing a Text Editor [message #332618] Fri, 31 October 2008 17:18
Adam Neal is currently offline Adam NealFriend
Messages: 40
Registered: July 2009
Member
Hi,

I'm having some troubles here, so if anyone can help me out I would really
appreciate it!

I have an IStorageEditorInput who 'Storage' is an IEncodedStorage. The
document of the IStorageEditorInput is being initialized with a Double Byte
Character Set (DBCS) character (e.g. a russian or japanese character) which
I have received as a String from elsewhere.
During the Editor initialization the StorageDocumentProvider is being used
to 'connect' the input (so far so good).

For simplification right now, I've hardcoded the result of
IEncodedStorage::getCharSet() to return "UTF-16".

The problem though, is when I reach
StorageDocumentProvider::setDocumentContent(IDocument, InputStream, String
encoding);
I can see, when debuging, that my InputStream (a DocumentInputStream) has
the correct text (looking at the fStore -> fText). In the debug view, it
shows 1 character, and it resolves the character properly when showing it in
the Variables view.

But when the BufferedReader is invoked (line 138 in
org.eclipse.ui.editors_3.4.0.v20080603-2000.jar ) to 'read' in this
character, all I get is garbage. I've tried with UTF-8, UTF-16, UTF-16BE,
UTF-16LE, all of which result in garbage when the stream is actually read
in.

Anyone have a guess what the issue might be? or can point me somewhere that
can help me? Or suggest another approach?
Thanks in advance,

Adam
Previous Topic:Can I prevent an editor from being restored?
Next Topic:Change in 3.4 in editor backgrounds?
Goto Forum:
  


Current Time: Thu Mar 28 17:21:14 GMT 2024

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

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

Back to the top