Opening a non-UTF-8 encoded text file? [message #784557] |
Fri, 27 January 2012 12:40  |
Eclipse User |
|
|
|
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 08:17  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.06527 seconds