Dear Jürgen, dear LyX developers, On 2019-03-30, Jürgen Spitzmüller wrote:
> After some more pondering, here is a proposal that, I think, addresses > my and your concerns: > * We keep the "auto" functionality as is (selecting the appropriate > 8bit encoding), but rename it (e.g., to \inputencoding traditional). Fine. (For the name I suggest "legacy-mix", "legacy-auto", or "legacy-encodings", to make clear that this setting tells LyX to use the legacy encoding for *each and every* of the languages in a document, possibly resulting in a mix of several encodings. Cf. https://www.lyx.org/trac/ticket/9883 When renaming, please also rename "\inputencoding default". This encoding is basically like the current "auto" but does not add the necessary code to tell LaTeX how to process them. I suggest "legacy-mix-plain" (similar to "utf8-plain"). > * We introduce a new default encoding, \inputencoding uni. Or keep the name "auto" and just change its meaning and GUI description. > * In languages, we keep the 8bit encodings, but rename Encoding to > TradEncoding, OK. (I suggest LegacyEncoding). We can skip the field for languages already defaulting to "utf8" but should also keep special variable-width and 16-bit default encodings. > introduce language.tradEncoding() and basically replace > all current calls to encoding(). > * Encoding now defaults to utf8, but it can be set to override this for > a given language (e.g., Japanese). We may simplify this, if all supported languages also support "utf8".² Otherwise: Would you also allow non-Unicode default encodings (jis-platex for Japanese (platex) or cp1255 for Hebrew, say)? Then, the name of the new default should rather not be "uni". > * \inputencoding uni selects language->encoding(). This is the main encoding for the document, right? Would you still consider the default "Encoding" for secondary languages (i.e. allow a mixed encoding of the LaTeX source)? +1 less verbose LaTeX source in some cases (Hebrew with Greek or Russian parts, say in cp1255 + utf8) -1 complex, fragile logic (cf. https://www.lyx.org/trac/ticket/11532) -1 does not work for Xe/LuaTeX with TeX fonts -1 does not work for platex > In the GUI, we get rid of the two radio boxes and add a combo instead > with > Encoding: Unicode (Default) > Traditional Language Default > Custom > Unicode (Default) is \inputencoding uni and the new default. We should keep the check for supported input encodings as well as the GUI names for supported input encodings (there is still a non-negligible chance to end up with a specific global encoding in imported LaTeX documents).¹ The legacy language default should be accessible but there is no need for a prominent position. How about Input Encoding: (·) Automatic ( ) Unicode (utf8) ( ) Other [ASCII (no inputenc)] with the "Other" box (almost) as now? Of course, we can also use nested combo-boxes instead. ASCII should be the default for "Other". > In lyx2lyx, we: > * convert/revert \inputencoding auto <-> traditional > * \inputencoding utf8 or utf8-platex <-> uni (for all languages that > have that) ¹ In tex2lyx, we: should use the new LaTeX default "utf8" (and consequently the new "auto" for languages that don't set a different default) rather than "legacy-mix-plain" for documents not loading inputenc. > We can do all this in subsequent steps. > That way, we don't lose the old functionality, but we make clear that > we have a new default. Thank you for the considerations, Günter ² I am working on enhancing Japanese (platex) to export with "platex" (instead of just failing) also for "inputenc==utf8" (modelled on the new behaviour of Japanese (CJK)). There is, however, an issue with a lot of characters that are well-supported by [utf8]{inputenc} but sub-optimal with platex. So we might need a separate encoding name just for the "force" flags in lib/unicodesymbols.
