JEdit supports encoding detection on unicode files
using the ByteOrderMarker. However XML and associated
files have a most specific encoding marker: in the <?
Eclipse Web Tools Platform handles this brilliantly:
if you change the encoding in the <?xml tag, the file
is automatically saved in the corresponding encoding!
No more manual encoding changing. And problems with
the conversion are reported.
So a file with:
<?xml version="1.0" encoding="iso-8859-1"?>
Is assumed to be in this encoding when read (update
buffer encoding setting after load) and is force-saved
in this encoding. When text is changed to:
<?xml version="1.0" encoding="utf-16"?>
and then saved, the buffer encoding is prio to saving
automatically changed to UTF-16 and the file is thus
saved. Maybe it is even possible to change the
encoding on-the-fly when the text is changed and the
line is exited?