Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Eclipse converts ascii to utf-8 without warning
Eclipse converts ascii to utf-8 without warning [message #1269929] Wed, 12 March 2014 10:21 Go to next message
Mark Holtkamp is currently offline Mark HoltkampFriend
Messages: 3
Registered: December 2010
Junior Member
Hi All,

My Eclipse workspace is set to UTF-8 as is my OS (Linux). When I open a file that is asccii encoded and contains extended ascii characters that are invalid utf-8, Eclipse gives no warning. When I save the file, Eclipse saves as utf-8 and replaces all invalid utf-8 character with the (valid) utf-8 character U+FFFD (displayed as �, hex EF BF BD).
I'd agree that the source file should not be asccii in the first place, still I'd like Eclipse to give a warning when opening a file that is invalid utf-8. Is there a setting in Eclipse to make it behave that way?
I am using Eclipe Kepler version 4.3.1 with PDT extension version 3.2.0

TIA, Mark.
Re: Eclipse converts ascii to utf-8 without warning [message #1270598 is a reply to message #1269929] Thu, 13 March 2014 07:41 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 355
Registered: July 2009
Location: Japan
Senior Member
You need to set "ISO-8859-1" to the file->Properties->Resource->Text file encoding.

BTW,
Since it is a matter of Eclipse Platform, not PDT, I recommend to re-post the issue on more responsible forum Eclipse Community Forums: Newcomers or Eclipse Community Forums: Eclipse Platform.
Eclipse Platform doesn't care if a file contains invalid utf-8 characters, and they are converted into the replacement character(U+FFFD) automatically, as you know.
This behaviour can be controled by CharsetDecoder and CodingErrorAction. I'm not sure but current implementation of Eclipse Platform seems to be not having such way. (I'm seeing org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.setDocumentContent(IDocument, IFile, String))
So, it's better to request the function you want against Eclipse Platform team, IMO.
Re: Eclipse converts ascii to utf-8 without warning [message #1272386 is a reply to message #1270598] Mon, 17 March 2014 20:14 Go to previous message
Mark Holtkamp is currently offline Mark HoltkampFriend
Messages: 3
Registered: December 2010
Junior Member
Thanks, I will rpost the question in the Eclipse platform forum

Mark
Previous Topic:Equal Sign Colour Matches Foreground
Next Topic:Eclipse error message while trying to open and RSE project
Goto Forum:
  


Current Time: Sat Nov 22 13:20:52 GMT 2014

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

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