Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Opening a non-UTF-8 encoded text file?
Opening a non-UTF-8 encoded text file? [message #784557] Fri, 27 January 2012 17:40 Go to next message
Lawrence Coffin is currently offline Lawrence CoffinFriend
Messages: 5
Registered: January 2012
Junior Member
Second question: How do I open a non-UTF-8 encoded text file and not have it corrupted by Eclipse? I.e. most text files written on a Windows machine (from Notepad, Wordpad, Word, WordPad, etc.) will be in Windows-1252 or some other non-UTF-8 encoding.

When opening these files, Eclipse silently replaces the high-ascii characters with the Unicode "replacement character" U+FFFD (byte sequence: 0xef 0xbf 0xbd). It would be better if Eclipse did any one of:

A) Autodetect correct encoding
B) Autodetect invalid encoding and prompted user to select encoding (and open in that encoding)
C) Autodetect invalid encoding, throw an error, and give the user some way to "Open with encoding" in the Open dialog box
D) Just throw an error and refuse to open the file

Current behavior means files opened in Eclipse are likely to be corrupted because the user is not informed that Eclipse has replaced characters.
Re: Opening a non-UTF-8 encoded text file? [message #787337 is a reply to message #784557] Tue, 31 January 2012 13:17 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 27.01.2012 18:40, Lawrence Coffin wrote:
> Second question: How do I open a non-UTF-8 encoded text file and not
> have it corrupted by Eclipse? I.e. most text files written on a
> Windows machine (from Notepad, Wordpad, Word, WordPad, etc.) will be
> in Windows-1252 or some other non-UTF-8 encoding.
>
> When opening these files, Eclipse silently replaces the high-ascii
> characters with the Unicode "replacement character" U+FFFD (byte
> sequence: 0xef 0xbf 0xbd). It would be better if Eclipse did any one of:
>
> A) Autodetect correct encoding
> B) Autodetect invalid encoding and prompted user to select encoding
> (and open in that encoding)
> C) Autodetect invalid encoding, throw an error, and give the user some
> way to "Open with encoding" in the Open dialog box
> D) Just throw an error and refuse to open the file
>
> Current behavior means files opened in Eclipse are likely to be
> corrupted because the user is not informed that Eclipse has replaced
> characters.
Please file a bug if a file got corrupted.

Dani
Previous Topic:Super simple: Importing into eclipse on a mac
Next Topic:Icons of Outline-view
Goto Forum:
  


Current Time: Fri Apr 26 04:59:27 GMT 2024

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

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

Back to the top