texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Display the `inputenc` names of the encoding names in the UI's bottom encoding drop down list

Open dbitouze opened this issue 3 years ago • 9 comments

Describe the feature and the current behavior/state

In the encoding drop down list at the UI's bottom, the names displayed:

  • UTF-8
  • windows-1252
  • macintosh
  • ISO-8859-1

are not clearly related to their inputenc (LaTeX package) counterparts:

  • utf8
  • cp1252
  • applemac
  • latin1

I suggest for the latter ones to be displayed as well (for instance in parentheses after the former ones).

Who will benefit with this feature?

Everyone, but especially beginners/intermediate users.

dbitouze avatar Sep 14 '21 18:09 dbitouze

Not that easy for a good first issue: I cannot find the file corresponding to this list of these (only) 4 encodings: UTF-8, windows-1252, macintosh, ISO-8859-1.

The file encoding.cpp contains much more encodings (and, I guess, is corresponding to the "Select File Encoding" dialog box (Edit → Setup Encoding... or, in the encoding drop down list at the UI's bottom, More Encodings).

dbitouze avatar Sep 23 '21 15:09 dbitouze

grafik (config dialog with encoding)

sunderme avatar Sep 23 '21 16:09 sunderme

and quick document: grafik

sunderme avatar Sep 23 '21 16:09 sunderme

OK, thanks. Anyway, not easy to figure out how to add the inputenc corresponding encodings. I don't want to break something.

dbitouze avatar Sep 23 '21 19:09 dbitouze

don't worry to break something. Firstly you will test yourself. Secondly the change will be reviewed for integration and any kinks will be discussed then.

sunderme avatar Sep 23 '21 19:09 sunderme

Sorry, I cannot see how to achieve the expected result (I don't know the C++ language).

dbitouze avatar Sep 23 '21 20:09 dbitouze

Sorry, I cannot see how to achieve the expected result (I don't know the C++ language).

I think that you only have to change this line from configmanager.cpp:

registerOption("Common Encodings", &commonEncodings, QStringList() << "UTF-8" << "ISO-8859-1" << "windows-1252" << "Apple Roman");

tmelorc avatar Dec 27 '21 18:12 tmelorc

grafik (config dialog with encoding)

In this piece of code, we see that UTF-8 string is added in both ui.comboBoxEncoding, ui.comboBoxBibFileEncoding, ui.comboBoxLogFileEncoding.

But I don't know if it is a good idea to change it to lowercase, since all other encodings added into those list are in uppercase.

tmelorc avatar Dec 27 '21 19:12 tmelorc

Sorry, I cannot see how to achieve the expected result (I don't know the C++ language).

I think that you only have to change this line from configmanager.cpp:

registerOption("Common Encodings", &commonEncodings, QStringList() << "UTF-8" << "ISO-8859-1" << "windows-1252" << "Apple Roman");

I suspect that this line is not being used anymore.

tmelorc avatar Dec 27 '21 19:12 tmelorc