From 606e6d7dd506032a3a70b0a754036f6030a74e82 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sat, 21 Oct 2006 15:03:21 +0000 Subject: [PATCH] Fix LaTeX output of characters on systems where char is signed git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15452 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/paragraph_pimpl.C | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index a2325e5456..3dd8318301 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -542,9 +542,18 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf, column += 15; break; - case '±': case '²': case '³': - case '×': case '÷': case '¹': - case '¬': case 'µ': + // The following characters could be written literally in latin1, but they + // would be wrongly converted on systems where char is signed, so we give + // the code points. + // This also makes us independant from the encoding of this source file. + case 0xb1: // ± PLUS-MINUS SIGN + case 0xb2: // ² SUPERSCRIPT TWO + case 0xb3: // ³ SUPERSCRIPT THREE + case 0xd7: // × MULTIPLICATION SIGN + case 0xf7: // ÷ DIVISION SIGN + case 0xb9: // ¹ SUPERSCRIPT ONE + case 0xac: // ¬ NOT SIGN + case 0xb5: // µ MICRO SIGN if ((bparams.inputenc == "latin1" || bparams.inputenc == "latin9") || (bparams.inputenc == "auto" && @@ -618,7 +627,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf, column += 9; break; - case '£': + case 0xa3: // £ POUND SIGN if (bparams.inputenc == "default") { os << "\\pounds{}"; column += 8; -- 2.39.2