#49 Automatic tweak of encoding declaration in buffer

plugins (30)

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?


  • YpsiloN

    YpsiloN - 2006-08-25

    Logged In: YES

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

  • Kazutoshi 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.

  • Kazutoshi Satoda

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

    Alan Ezust - 2011-11-30

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

  • Alan Ezust

    Alan Ezust - 2011-11-30
    • assigned_to: nobody --> k_satoda
    • status: open --> closed-fixed
  • Kazutoshi Satoda

    • assigned_to: k_satoda --> nobody
    • status: closed-fixed --> open
  • Kazutoshi 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.

  • Jarek Czekalski

    Jarek Czekalski - 2011-12-09

    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.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks