Preamble section patch

Lorenzo Bertini lorenzobertini97 at gmail.com
Wed Sep 30 11:07:56 UTC 2020


Il 28/09/20 22:57, Richard Kimberly Heck ha scritto:
> So can you create a file with the new preamble that might cause a problem so we can see exactly what it is?
> 
> Riki

My problem is with the following (pseudo)code, that is present in
writeLatex, but not in my code:

> // Check if the user preamble contains uncodable glyphs
> odocstringstream user_preamble;
> Encoding * enc = features.runparams().encoding;
> if (enc) {
> 	for (n in preamble.size()) {
> 		char c = preamble[n];
> 		if (!enc->encodable(c))	LYXERR0("Uncodable character");
> 		else			user_preamble.put(c);
> 	}
> }

I tried manually inserting copy-pasted "illegal" utf-8 characters
(example: ࠀ) into both preambles (if this sounds stupid it's because it
is, I don't know much about encoding) and neither produced the expected
error (the LaTeX one produced an encoding error by other means, the
message wasn't the one expected).

While doing this I found that saving the preamble and closing the window
(triggering saving the cursors position, etc) and opening it again
breaks the second preamble tab text: don't bother looking into the
patch, it needs a lot of fixing. I'm on it.

Sorry for being rushed, Lo


More information about the lyx-devel mailing list