PreviousNextTracker indexSee it online !

(18/212) 49 - Automatic tweak of encoding declaration in buffer

JEdit supports encoding detection on unicode files
using the ByteOrderMarker. However XML and associated
files have a most specific encoding marker: in the <?
xml encoding="..."?>

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?

Submitted tbee - 2006-08-23 14:28:02 Assigned
Priority 5 Labels plugins
Status open Group None
Resolution None

Comments

2006-08-25 10:54:22
priitoorn

Logged In: YES
user_id=1570477

same thing please for the HTML/XHTML files with the tag:
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">

2008-09-10 16:58:08
k_satoda

- **summary**: XML, XSL, XSD ... encoding --> Automatic tweak of encoding declaration in buffer

2008-09-10 16:58:08
k_satoda

jEdit detects encoding with XML-PI by default. An option to detect
charset declaration in HMTL's meta tag was added in r13639.

The remaining feature in this request is, automatic tweak of encoding
declaration in buffer.

2011-11-30 05:28:07
ezust

now there is an html and xml encoding recognizer, so this feature request is closed.

2011-11-30 05:28:07
ezust

- **assigned_to**: nobody --> k_satoda
- **status**: open --> closed-fixed

2011-12-08 18:09:06
k_satoda

- **assigned_to**: k_satoda --> nobody
- **status**: closed-fixed --> open

2011-12-08 18:09:06
k_satoda

This request is not only for detection, but also for automatic tweak of
encoding declaration in a buffer, and automatic change of encoding on
save after editing the declaration. They are still missing.

2011-12-09 07:02:31
jarekczek

Please leave the user opportunity to override such automatic change of encoding. On load it can be overriden by manually choosing the encoding. If there will be no such possibility on save, then at least turning off the encoding detector in global properties should make the automat stop working.

I was also working on an editor that did it automatically. I did not always like it.