Re: Character encodings for files
Dale Anson <[email protected]>
| Newsgroups | gmane.editors.jedit.user |
|---|---|
| Message-ID | <CAHrA0wB-Yb_rbY6bEkbtawaGSd8ah-tGAA0UM9CHkeY-8ftcng@mail.gmail.com> |
Unfortunately, there isn't a built-in way to do that, and I'm not aware of a plugin that provides that feature. The jEdit API doesn't really provide a way to set encoding by file type, rather it uses bytes from an input stream and doesn't give access to the file itself, so without an API change, a plugin couldn't do what you're asking. I'm assuming you have the auto detect encoding turned on? Dale On Mon, Nov 18, 2019, 7:30 AM Edward Diener <[email protected]> wrote: > On 11/18/2019 5:31 AM, Moti Ben-Ari wrote: > > Use File/Reload with Encoding to use a different encoding for an > > individual file. > > > > Note that there are a large number of encodings which can be a pain > > since utf8 is near the end :-(. Go to Utilities/Global Options/Encodings > > and drag to Selected encoding(s) the ones you need. > > I am fully aware that I can open an individual file with a particular > encoding using File/Reload with Encoding. But if you read my OP below > that is not what I asked about. I want to have the ability to > automatically open certain file types as defined by file globs and a > file location with an encoding that is not the single default encoding > defined by Global Options | Encodings | Default Character Encoding. In > other words I find the single default character encoding, applied to all > files for which I have not changed to a different encoding, to be a very > limited way of specifying what encoding I want for files. > > > > > On Mon, Nov 18, 2019 at 8:03 AM Edward Diener <[email protected] > > <mailto:[email protected]>> wrote: > > > > I do not see anything the JEdit settings that lets me control the > > character encoding which certain types of files, or certain types of > > files in certain directories, should be opened with. Does this exist > in > > JEdit ? I only noticed a global option for the default encoding. > Have a > > I missed something, or does JEdit, or perhaps a JEdit plugin, let me > > control the character encoding with which certain files are opened. > > > > While the default encoding under Windows, Cp1252, works well for the > > vast majority of files there are a number of files which should be > > opened with the UTF8 encoding instead. In particular nearly all git > > files in git repositories are UTF8. > > > > I did notice that once I changed the character encoding for a > > particular > > file that JEdit retains this even between sessions, so evidently > JEdit > > can associate a character encoding with a particular file whenever I > > edit the file. But what I am looking for is the ability to say that > all > > the files of a particular file glob within a particular > > directory/subdirectories should be opened with some encoding which is > > not the default encoding. > > > > -- > ----------------------------------------------- > jEdit Users' List > [email protected] > https://lists.sourceforge.net/lists/listinfo/jedit-users > -- ----------------------------------------------- jEdit Users' List [email protected] https://lists.sourceforge.net/lists/listinfo/jedit-users