]> git.lyx.org Git - features.git/commitdiff
Fix LaTeX output of characters on systems where char is signed
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 21 Oct 2006 15:03:21 +0000 (15:03 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 21 Oct 2006 15:03:21 +0000 (15:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15452 a592a061-630c-0410-9148-cb99ea01b6c8

src/paragraph_pimpl.C

index a2325e5456367fd139373a8e8518070353874397..3dd8318301ad70f5906cdbf8bc7db0cc1c516d53 100644 (file)
@@ -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;