diff --git a/Text/TeXMath/Parser.hs b/Text/TeXMath/Parser.hs
--- a/Text/TeXMath/Parser.hs
+++ b/Text/TeXMath/Parser.hs
@@ -392,8 +392,8 @@
 identifier = lexeme (P.identifier lexer)
 
 operator :: CharParser st String
-operator = lexeme $ liftM (:[]) (opLetter texMathDef)
-                 <|> many1 (char '\'')
+operator = lexeme $ many1 (char '\'')
+                 <|> liftM (:[]) (opLetter texMathDef)
 
 symbol :: String -> CharParser st String
 symbol = lexeme . P.symbol lexer
@@ -459,7 +459,7 @@
 symbols :: M.Map String Exp
 symbols = M.fromList [
              ("+", ESymbol Bin "+")
-           , ("-", ESymbol Bin "-")
+           , ("-", ESymbol Bin "\x2212")
            , ("*", ESymbol Bin "*")
            , (",", ESymbol Pun ",")
            , (".", ESymbol Pun ".")
diff --git a/tests/01.xhtml b/tests/01.xhtml
--- a/tests/01.xhtml
+++ b/tests/01.xhtml
@@ -10,7 +10,7 @@
         <mo>=</mo>
         <mfrac>
           <mrow>
-            <mo>-</mo>
+            <mo>&#8722;</mo>
             <mi>b</mi>
             <mo>&#177;</mo>
             <msqrt>
@@ -19,7 +19,7 @@
                   <mi>b</mi>
                   <mn>2</mn>
                 </msup>
-                <mo>-</mo>
+                <mo>&#8722;</mo>
                 <mn>4</mn>
                 <mi>a</mi>
                 <mi>c</mi>
diff --git a/tests/02.xhtml b/tests/02.xhtml
--- a/tests/02.xhtml
+++ b/tests/02.xhtml
@@ -15,7 +15,7 @@
               <mrow>
                 <mo stretchy="true">(</mo>
                 <mn>3</mn>
-                <mo>-</mo>
+                <mo>&#8722;</mo>
                 <mi>x</mi>
                 <mo stretchy="true">)</mo>
               </mrow>
@@ -24,7 +24,7 @@
             </mrow>
             <mrow>
               <mn>3</mn>
-              <mo>-</mo>
+              <mo>&#8722;</mo>
               <mi>x</mi>
             </mrow>
           </mfrac>
diff --git a/tests/04.xhtml b/tests/04.xhtml
--- a/tests/04.xhtml
+++ b/tests/04.xhtml
@@ -15,13 +15,13 @@
           <mi>S</mi>
           <mtext mathvariant="normal">old</mtext>
         </msub>
-        <mo>-</mo>
+        <mo>&#8722;</mo>
         <mfrac>
           <msup>
             <mrow>
               <mo stretchy="true">(</mo>
               <mn>5</mn>
-              <mo>-</mo>
+              <mo>&#8722;</mo>
               <mi>T</mi>
               <mo stretchy="true">)</mo>
             </mrow>
diff --git a/tests/05.xhtml b/tests/05.xhtml
--- a/tests/05.xhtml
+++ b/tests/05.xhtml
@@ -41,7 +41,7 @@
         <mo stretchy="false">)</mo>
         <mo stretchy="false">(</mo>
         <mi>x</mi>
-        <mo>-</mo>
+        <mo>&#8722;</mo>
         <mi>y</mi>
         <mo stretchy="false">)</mo>
         <mspace width="0.167em" />
diff --git a/tests/07.xhtml b/tests/07.xhtml
--- a/tests/07.xhtml
+++ b/tests/07.xhtml
@@ -7,8 +7,7 @@
     <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
       <mrow>
         <mi>u</mi>
-        <mo>&#697;</mo>
-        <mo>&#697;</mo>
+        <mo>&#698;</mo>
         <mo>+</mo>
         <mi>p</mi>
         <mo stretchy="false">(</mo>
diff --git a/tests/11.xhtml b/tests/11.xhtml
--- a/tests/11.xhtml
+++ b/tests/11.xhtml
@@ -25,7 +25,7 @@
         <msup>
           <mo>&#954;</mo>
           <mrow>
-            <mo>-</mo>
+            <mo>&#8722;</mo>
             <mn>11</mn>
             <mo>/</mo>
             <mn>3</mn>
diff --git a/tests/12.xhtml b/tests/12.xhtml
--- a/tests/12.xhtml
+++ b/tests/12.xhtml
@@ -19,7 +19,7 @@
                 <mn>1</mn>
               </mtd>
               <mtd>
-                <mo>-</mo>
+                <mo>&#8722;</mo>
                 <mn>1</mn>
                 <mo>&#8804;</mo>
                 <mi>x</mi>
@@ -43,7 +43,7 @@
             <mtr>
               <mtd>
                 <mn>1</mn>
-                <mo>-</mo>
+                <mo>&#8722;</mo>
                 <msup>
                   <mi>x</mi>
                   <mn>2</mn>
diff --git a/tests/binomial_coefficient.xhtml b/tests/binomial_coefficient.xhtml
--- a/tests/binomial_coefficient.xhtml
+++ b/tests/binomial_coefficient.xhtml
@@ -46,7 +46,7 @@
             <mspace width="0.167em" />
             <mo stretchy="false">(</mo>
             <mi>n</mi>
-            <mo>-</mo>
+            <mo>&#8722;</mo>
             <mi>k</mi>
             <mo stretchy="false">)</mo>
             <mo>!</mo>
diff --git a/tests/moore_determinant.xhtml b/tests/moore_determinant.xhtml
--- a/tests/moore_determinant.xhtml
+++ b/tests/moore_determinant.xhtml
@@ -36,7 +36,7 @@
                     <mi>q</mi>
                     <mrow>
                       <mi>n</mi>
-                      <mo>-</mo>
+                      <mo>&#8722;</mo>
                       <mn>1</mn>
                     </mrow>
                   </msup>
@@ -68,7 +68,7 @@
                     <mi>q</mi>
                     <mrow>
                       <mi>n</mi>
-                      <mo>-</mo>
+                      <mo>&#8722;</mo>
                       <mn>1</mn>
                     </mrow>
                   </msup>
@@ -114,7 +114,7 @@
                     <mi>q</mi>
                     <mrow>
                       <mi>n</mi>
-                      <mo>-</mo>
+                      <mo>&#8722;</mo>
                       <mn>1</mn>
                     </mrow>
                   </msup>
diff --git a/tests/quadratic_formula.xhtml b/tests/quadratic_formula.xhtml
--- a/tests/quadratic_formula.xhtml
+++ b/tests/quadratic_formula.xhtml
@@ -10,7 +10,7 @@
         <mo>=</mo>
         <mfrac>
           <mrow>
-            <mo>-</mo>
+            <mo>&#8722;</mo>
             <mi>b</mi>
             <mo>&#177;</mo>
             <msqrt>
@@ -19,7 +19,7 @@
                   <mi>b</mi>
                   <mn>2</mn>
                 </msup>
-                <mo>-</mo>
+                <mo>&#8722;</mo>
                 <mn>4</mn>
                 <mi>a</mi>
                 <mi>c</mi>
diff --git a/tests/schwinger_dyson.xhtml b/tests/schwinger_dyson.xhtml
--- a/tests/schwinger_dyson.xhtml
+++ b/tests/schwinger_dyson.xhtml
@@ -33,7 +33,7 @@
           <mo stretchy="true">&#10217;</mo>
         </mrow>
         <mo>=</mo>
-        <mo>-</mo>
+        <mo>&#8722;</mo>
         <mtext mathvariant="normal">i</mtext>
         <mrow>
           <mo stretchy="true">&#10216;</mo>
diff --git a/tests/sophomores_dream.xhtml b/tests/sophomores_dream.xhtml
--- a/tests/sophomores_dream.xhtml
+++ b/tests/sophomores_dream.xhtml
@@ -30,7 +30,7 @@
         </munderover>
         <mrow>
           <mo stretchy="false">(</mo>
-          <mo>-</mo>
+          <mo>&#8722;</mo>
           <mn>1</mn>
           <msup>
             <mo stretchy="false">)</mo>
@@ -44,7 +44,7 @@
           <msup>
             <mi>n</mi>
             <mrow>
-              <mo>-</mo>
+              <mo>&#8722;</mo>
               <mi>n</mi>
             </mrow>
           </msup>
diff --git a/tests/sphere_volume.xhtml b/tests/sphere_volume.xhtml
--- a/tests/sphere_volume.xhtml
+++ b/tests/sphere_volume.xhtml
@@ -116,7 +116,7 @@
               </msubsup>
               <mo> </mo>
               <mo stretchy="false">(</mo>
-              <mo>-</mo>
+              <mo>&#8722;</mo>
               <mi>cos</mi>
               <mo>&#952;</mo>
               <mo stretchy="false">)</mo>
diff --git a/texmath.cabal b/texmath.cabal
--- a/texmath.cabal
+++ b/texmath.cabal
@@ -1,5 +1,5 @@
 Name:                texmath
-Version:             0.5.0.1
+Version:             0.5.0.2
 Cabal-version:       >= 1.2
 Build-type:          Custom
 Synopsis:            Conversion of LaTeX math formulas to MathML.
diff --git a/texmath.hs b/texmath.hs
--- a/texmath.hs
+++ b/texmath.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 module Main where
 
 import Text.TeXMath
@@ -15,9 +16,17 @@
         unode "meta" ()
     , unode "body" x ]
 
+getUTF8Contents :: IO String
+getUTF8Contents =
+#if MIN_VERSION_base(4,2,0)
+       hSetEncoding stdin utf8 >> hGetContents stdin
+#else
+       hGetContents stdin
+#endif
+
 main :: IO ()
 main = do
-  inp <- getContents
+  inp <- getUTF8Contents
   let (ms, rest) = parseMacroDefinitions inp
   case (texMathToMathML DisplayBlock $! applyMacros ms rest) of
         Left err         -> hPutStrLn stderr err
