git.iko.soy/typeable/pandoc
on master help sign in
Simplified and improved UTF8 handling:

+ Removed utf8-string cabal configuration flag. + Instead, we just include System.IO.UTF8 and Codec.Binary.UTF8.String from utf8-string package in the source tree, avoiding a dependency on utf8-string and avoiding crufty custom UTF8 code. (The old Text.Pandoc.UTF8 had problems with the getContents function.) + Removed lots of CPP directives that are no longer needed. + In Setup.hs, use '-i..' in running RunTests.hs, so the local UTF8 code will be found. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1411 788f1e2b-df1e-0410-8736-df70ead52e1b

commitd00da316227c26bad857998d0398a23917ee0a7b authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 14 Aug 2008, 01:32 (18 years ago) parent8388427
12 files changed+246−154
Codec/Binary/UTF8/String.hs+97 INSTALL−5 Main.hs−9 Setup.hs+1−1 System/IO/UTF8.hs+118 Text/Pandoc/ODT.hs+1−5 Text/Pandoc/PDF.hs−5 Text/Pandoc/Shared.hs−4 Text/Pandoc/TH.hs−5 Text/Pandoc/UTF8.hs−76 debian/copyright+24−30 pandoc.cabal+5−14
Codec/Binary/UTF8/String.hsnew file+97
@@ -0,0 +1,97 @@
1+--
2+-- |
3+-- Module : Codec.Binary.UTF8.String
4+-- Copyright : (c) Eric Mertens 2007
5+-- License : BSD3-style (see LICENSE)
6+--
7+-- Maintainer: emertens@galois.com
8+-- Stability : experimental
9+-- Portability : portable
10+--
11+-- Support for encoding UTF8 Strings to and from @[Word8]@
12+--
13+
14+module Codec.Binary.UTF8.String (
15+ encode
16+ , decode
17+ , encodeString
18+ , decodeString
19+ ) where
20+
21+import Data.Word (Word8)
22+import Data.Bits ((.|.),(.&.),shiftL,shiftR)
23+import Data.Char (chr,ord)
24+
25+default(Int)
26+
27+-- | Encode a string using 'encode' and store the result in a 'String'.
28+encodeString :: String -> String
29+encodeString xs = map (toEnum . fromEnum) (encode xs)
30+
31+-- | Decode a string using 'decode' using a 'String' as input.
32+-- | This is not safe but it is necessary if UTF-8 encoded text
33+-- | has been loaded into a 'String' prior to being decoded.
34+decodeString :: String -> String
35+decodeString xs = decode (map (toEnum . fromEnum) xs)
36+
37+replacement_character :: Char
38+replacement_character = '\xfffd'
39+
40+-- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
41+encode :: String -> [Word8]
42+encode = concatMap (map fromIntegral . go . ord)
43+ where
44+ go oc
45+ | oc <= 0x7f = [oc]
46+
47+ | oc <= 0x7ff = [ 0xc0 + (oc `shiftR` 6)
48+ , 0x80 + oc .&. 0x3f
49+ ]
50+
51+ | oc <= 0xffff = [ 0xe0 + (oc `shiftR` 12)
52+ , 0x80 + ((oc `shiftR` 6) .&. 0x3f)
53+ , 0x80 + oc .&. 0x3f
54+ ]
55+ | otherwise = [ 0xf0 + (oc `shiftR` 18)
56+ , 0x80 + ((oc `shiftR` 12) .&. 0x3f)
57+ , 0x80 + ((oc `shiftR` 6) .&. 0x3f)
58+ , 0x80 + oc .&. 0x3f
59+ ]
60+
61+--
62+-- | Decode a UTF8 string packed into a list of Word8 values, directly to String
63+--
64+decode :: [Word8] -> String
65+decode [ ] = ""
66+decode (c:cs)
67+ | c < 0x80 = chr (fromEnum c) : decode cs
68+ | c < 0xc0 = replacement_character : decode cs
69+ | c < 0xe0 = multi1
70+ | c < 0xf0 = multi_byte 2 0xf 0x800
71+ | c < 0xf8 = multi_byte 3 0x7 0x10000
72+ | c < 0xfc = multi_byte 4 0x3 0x200000
73+ | c < 0xfe = multi_byte 5 0x1 0x4000000
74+ | otherwise = replacement_character : decode cs
75+ where
76+ multi1 = case cs of
77+ c1 : ds | c1 .&. 0xc0 == 0x80 ->
78+ let d = ((fromEnum c .&. 0x1f) `shiftL` 6) .|. fromEnum (c1 .&. 0x3f)
79+ in if d >= 0x000080 then toEnum d : decode ds
80+ else replacement_character : decode ds
81+ _ -> replacement_character : decode cs
82+
83+ multi_byte :: Int -> Word8 -> Int -> [Char]
84+ multi_byte i mask overlong = aux i cs (fromEnum (c .&. mask))
85+ where
86+ aux 0 rs acc
87+ | overlong <= acc && acc <= 0x10ffff &&
88+ (acc < 0xd800 || 0xdfff < acc) &&
89+ (acc < 0xfffe || 0xffff < acc) = chr acc : decode rs
90+ | otherwise = replacement_character : decode rs
91+
92+ aux n (r:rs) acc
93+ | r .&. 0xc0 == 0x80 = aux (n-1) rs
94+ $ shiftL acc 6 .|. fromEnum (r .&. 0x3f)
95+
96+ aux _ rs _ = replacement_character : decode rs
97+
INSTALL−5
@@ -24,10 +24,6 @@ GHC and the required libraries using `apt-get`:
2424
2525 sudo apt-get install ghc6 libghc6-xhtml-dev libghc6-mtl-dev libghc6-network-dev
2626
27−Pandoc will use the [utf8-string] library if it is installed; otherwise, it
28−will use its own internal module for UTF-8 I/O. The utf8-string library is
29−not a required dependency, but it may improve performance slightly.
30−
3127[GHC]: http://www.haskell.org/ghc/
3228[GHC Download]: http://www.haskell.org/ghc/download.html
3329[Cabal]: http://www.haskell.org/cabal/
@@ -36,7 +32,6 @@ not a required dependency, but it may improve performance slightly.
3632[Fink]: http://finkproject.org
3733[Ubuntu]: http://www.ubuntu.com
3834[debian]: http://www.debian.org/
39−[utf8-string]: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/utf8-string
4035
4136Getting the source
4237------------------
Main.hs−9
@@ -43,11 +43,7 @@ import Data.Maybe ( fromMaybe )
4343import Data.Char ( toLower )
4444import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
4545import System.IO ( stdout, stderr )
46−#ifdef _UTF8STRING
4746import System.IO.UTF8
48−#else
49−import Text.Pandoc.UTF8
50−#endif
5147#ifdef _CITEPROC
5248import Text.CSL
5349import Text.Pandoc.Biblio
@@ -61,11 +57,6 @@ copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n" ++
6157
6258compileInfo :: String
6359compileInfo =
64−#ifdef _UTF8STRING
65− " +utf8-string" ++
66−#else
67− " -utf8-string" ++
68−#endif
6960#ifdef _CITEPROC
7061 " +citeproc" ++
7162#else
Setup.hs+1−1
@@ -17,7 +17,7 @@ main = defaultMainWithHooks $
1717
1818-- | Run test suite.
1919runTestSuite _ _ _ _ = do
20− inDirectory "tests" $ runCommand "runhaskell RunTests.hs" >>= waitForProcess
20+ inDirectory "tests" $ runCommand "runhaskell -i.. RunTests.hs" >>= waitForProcess
2121 return ()
2222
2323-- | If reference.odt needs rebuilding, build it.
System/IO/UTF8.hsnew file+118
@@ -0,0 +1,118 @@
1+-----------------------------------------------------------------------------
2+-- |
3+-- Module : System.IO.UTF8
4+-- Copyright : (c) Eric Mertens 2007
5+-- License : BSD3-style (see LICENSE)
6+--
7+-- Maintainer: emertens@galois.com
8+-- Stability : experimental
9+-- Portability : portable
10+--
11+-- String IO preserving UTF8 encoding.
12+--
13+
14+module System.IO.UTF8 (
15+ print
16+ , putStr
17+ , putStrLn
18+ , getLine
19+ , readLn
20+ , readFile
21+ , writeFile
22+ , appendFile
23+ , getContents
24+ , hGetLine
25+ , hGetContents
26+ , hPutStr
27+ , hPutStrLn
28+ ) where
29+
30+import Control.Monad (liftM)
31+import Data.Char (ord, chr)
32+import Data.Word (Word8)
33+import Prelude (String, ($), (=<<), (>>=), (.), map, toEnum, fromEnum, Read,
34+ Show(..))
35+import System.IO (Handle, IO, FilePath)
36+import qualified System.IO as IO
37+
38+import Codec.Binary.UTF8.String (encode, decode)
39+
40+
41+-- | Encode a string in UTF8 form.
42+encodeString :: String -> String
43+encodeString xs = bytesToString (encode xs)
44+
45+-- | Decode a string from UTF8
46+decodeString :: String -> String
47+decodeString xs = decode (stringToBytes xs)
48+
49+-- | Convert a list of bytes to a String
50+bytesToString :: [Word8] -> String
51+bytesToString xs = map (chr . fromEnum) xs
52+
53+-- | String to list of bytes.
54+stringToBytes :: String -> [Word8]
55+stringToBytes xs = map (toEnum . ord) xs
56+
57+-- | The 'print' function outputs a value of any printable type to the
58+-- standard output device. This function differs from the
59+-- System.IO.print in that it preserves any UTF8 encoding of the shown value.
60+--
61+print :: Show a => a -> IO ()
62+print x = putStrLn (show x)
63+
64+-- | Write a UTF8 string to the standard output device
65+putStr :: String -> IO ()
66+putStr x = IO.putStr (encodeString x)
67+
68+-- | The same as 'putStr', but adds a newline character.
69+putStrLn :: String -> IO ()
70+putStrLn x = IO.putStrLn (encodeString x)
71+
72+-- | Read a UTF8 line from the standard input device
73+getLine :: IO String
74+getLine = liftM decodeString IO.getLine
75+
76+-- | The 'readLn' function combines 'getLine' and 'readIO', preserving UTF8
77+readLn :: Read a => IO a
78+readLn = IO.readIO =<< getLine
79+
80+-- | The 'readFile' function reads a file and
81+-- returns the contents of the file as a UTF8 string.
82+-- The file is read lazily, on demand, as with 'getContents'.
83+readFile :: FilePath -> IO String
84+readFile n = liftM decodeString (IO.openBinaryFile n IO.ReadMode >>=
85+ IO.hGetContents)
86+
87+-- | The computation 'writeFile' @file str@ function writes the UTF8 string @str@,
88+-- to the file @file@.
89+writeFile :: FilePath -> String -> IO ()
90+writeFile n c = IO.withBinaryFile n IO.WriteMode $ \ h ->
91+ IO.hPutStr h $ encodeString c
92+
93+-- | The computation 'appendFile' @file str@ function appends the UTF8 string @str@,
94+-- to the file @file@.
95+appendFile :: FilePath -> String -> IO ()
96+appendFile n c = IO.withBinaryFile n IO.AppendMode $ \h ->
97+ IO.hPutStr h $ encodeString c
98+
99+-- | Read a UTF8 line from a Handle
100+hGetLine :: Handle -> IO String
101+hGetLine h = liftM decodeString $ IO.hGetLine h
102+
103+-- | Lazily read a UTF8 string from a Handle
104+hGetContents :: Handle -> IO String
105+hGetContents h = liftM decodeString (IO.hGetContents h)
106+
107+-- | Write a UTF8 string to a Handle.
108+hPutStr :: Handle -> String -> IO ()
109+hPutStr h s = IO.hPutStr h (encodeString s)
110+
111+-- | Write a UTF8 string to a Handle, appending a newline.
112+hPutStrLn :: Handle -> String -> IO ()
113+hPutStrLn h s = IO.hPutStrLn h (encodeString s)
114+
115+-- | Lazily read stdin as a UTF8 string.
116+getContents :: IO String
117+getContents = liftM decodeString IO.getContents
118+
Text/Pandoc/ODT.hs+1−5
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TemplateHaskell, CPP #-}
1+{-# LANGUAGE TemplateHaskell #-}
22{-
33Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
44
@@ -44,11 +44,7 @@ import qualified Data.ByteString as B ( writeFile, pack )
4444import Data.ByteString.Internal ( c2w )
4545import Prelude hiding ( writeFile, readFile )
4646import System.IO ( stderr )
47−#ifdef _UTF8STRING
4847import System.IO.UTF8
49−#else
50−import Text.Pandoc.UTF8
51−#endif
5248
5349-- | Produce an ODT file from OpenDocument XML.
5450saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
Text/Pandoc/PDF.hs−5
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
21{-
32Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
43
@@ -38,11 +37,7 @@ import System.Environment ( getEnvironment )
3837import Text.Pandoc.Shared ( withTempDir )
3938import Prelude hiding ( writeFile, readFile, putStrLn )
4039import System.IO ( stderr, openFile, IOMode (..), hClose )
41−#ifdef _UTF8STRING
4240import System.IO.UTF8
43−#else
44−import Text.Pandoc.UTF8
45−#endif
4641
4742-- | Produce an PDF file from LaTeX.
4843saveLaTeXAsPDF :: FilePath -- ^ Pathname of PDF file to be produced.
Text/Pandoc/Shared.hs−4
@@ -118,11 +118,7 @@ import System.FilePath ( (</>), (<.>) )
118118import System.IO.Error ( catch, ioError, isAlreadyExistsError )
119119import System.Directory
120120import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
121−#ifdef _UTF8STRING
122121import System.IO.UTF8
123−#else
124−import Text.Pandoc.UTF8
125−#endif
126122
127123--
128124-- List processing
Text/Pandoc/TH.hs−5
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
21{-# OPTIONS_GHC -fno-warn-orphans #-}
32{-
43Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
@@ -39,11 +38,7 @@ import Language.Haskell.TH.Syntax (Lift (..))
3938import qualified Data.ByteString as B
4039import Data.ByteString.Internal ( w2c )
4140import Prelude hiding ( readFile )
42−#ifdef _UTF8STRING
4341import System.IO.UTF8
44−#else
45−import Text.Pandoc.UTF8
46−#endif
4742
4843-- | Insert contents of text file into a template.
4944contentsOf :: FilePath -> ExpQ
Text/Pandoc/UTF8.hsdeleted−76
@@ -1,76 +0,0 @@
1−-- | Functions for IO using UTF-8 encoding.
2−--
3−-- The basic encoding and decoding functions are taken from
4−-- <http://www.cse.ogi.edu/~hallgren/Talks/LHiH/base/lib/UTF8.hs>.
5−-- (c) 2003, OGI School of Science & Engineering, Oregon Health and
6−-- Science University.
7−--
8−-- From the Char module supplied with HBC.
9−-- Modified by Martin Norbaeck to pass illegal UTF-8 sequences unchanged.
10−-- Modified by John MacFarlane to use [Word8] and export IO functions.
11−
12−module Text.Pandoc.UTF8 (
13− putStrLn
14− , putStr
15− , hPutStrLn
16− , hPutStr
17− , getContents
18− , readFile
19− , writeFile
20− ) where
21−import Data.Word
22−import System.IO ( Handle )
23−import qualified Data.ByteString.Lazy as BS
24−import Prelude hiding ( putStrLn, putStr, getContents, readFile, writeFile )
25−
26−putStrLn :: String -> IO ()
27−putStrLn = BS.putStrLn . BS.pack . toUTF8
28−
29−putStr :: String -> IO ()
30−putStr = BS.putStr . BS.pack . toUTF8
31−
32−hPutStrLn :: Handle -> String -> IO ()
33−hPutStrLn h = BS.hPut h . BS.pack . toUTF8 . (++ "\n")
34−
35−hPutStr :: Handle -> String -> IO ()
36−hPutStr h = BS.hPut h . BS.pack . toUTF8
37−
38−readFile :: FilePath -> IO String
39−readFile p = BS.readFile p >>= return . fromUTF8 . BS.unpack
40−
41−writeFile :: FilePath -> String -> IO ()
42−writeFile p = BS.writeFile p . BS.pack . toUTF8
43−
44−getContents :: IO String
45−getContents = BS.getContents >>= return . fromUTF8 . BS.unpack
46−
47−-- | Take a list of bytes in UTF-8 encoding and decode it into a Unicode string.
48−fromUTF8 :: [Word8] -> String
49−fromUTF8 [] = ""
50−fromUTF8 (0xef : 0xbb : 0xbf :cs) = fromUTF8 cs -- skip BOM (byte order marker)
51−fromUTF8 (c:c':cs) | 0xc0 <= c && c <= 0xdf &&
52− 0x80 <= c' && c' <= 0xbf =
53− toEnum ((fromEnum c `mod` 0x20) * 0x40 + fromEnum c' `mod` 0x40) : fromUTF8 cs
54−fromUTF8 (c:c':c'':cs) | 0xe0 <= c && c <= 0xef &&
55− 0x80 <= c' && c' <= 0xbf &&
56− 0x80 <= c'' && c'' <= 0xbf =
57− toEnum ((fromEnum c `mod` 0x10 * 0x1000) + (fromEnum c' `mod` 0x40) * 0x40 + fromEnum c'' `mod` 0x40) : fromUTF8 cs
58−fromUTF8 (c:cs) = toEnum (fromEnum c) : fromUTF8 cs
59−
60−-- | Take a Unicode string and encode it as a list of bytes in UTF-8 encoding.
61−toUTF8 :: String -> [Word8]
62−toUTF8 "" = []
63−toUTF8 (c:cs) =
64− if c > '\x0000' && c < '\x0080' then
65− toEnum (fromEnum c) : toUTF8 cs
66− else if c < toEnum 0x0800 then
67− let i = fromEnum c
68− in toEnum (0xc0 + i `div` 0x40) :
69− toEnum (0x80 + i `mod` 0x40) :
70− toUTF8 cs
71− else
72− let i = fromEnum c
73− in toEnum (0xe0 + i `div` 0x1000) :
74− toEnum (0x80 + (i `mod` 0x1000) `div` 0x40) :
75− toEnum (0x80 + i `mod` 0x40) :
76− toUTF8 cs
debian/copyright+24−30
@@ -58,42 +58,36 @@ by Eric A. Meyer
5858Released under an explicit Public Domain License
5959
6060----------------------------------------------------------------------
61−UTF8.hs
62−Copyright (c) 2003, OGI School of Science & Engineering, Oregon Health &
63−Science University, All rights reserved.
64−Modified by Martin Norbäck, to pass illegal utf-8 sequences through unchanged.
65−Modified 2006-8 John MacFarlane.
61+System/IO/UTF8.hs and Codec/Binary/UTF8/String.hs
62+from the utf8-string package on HackageDB
63+Copyright (c) 2007, Galois Inc.
64+All rights reserved.
6665
6766Redistribution and use in source and binary forms, with or without
68−modification, are permitted provided that the following conditions
69−are met:
70−
71−- Redistributions of source code must retain the above copyright
72− notice, this list of conditions and the following disclaimer.
73−
74−- Redistributions in binary form must reproduce the above
75− copyright notice, this list of conditions and the following
76− disclaimer in the documentation and/or other materials provided
77− with the distribution.
78−
79−- Neither the name of OGI or OHSU nor the names of its
80− contributors may be used to endorse or promote products derived
81− from this software without specific prior written permission.
82−
83−THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
84−"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
85−LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
86−A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
87−OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
88−SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
89−TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
90−PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
91−LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
92−NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
67+modification, are permitted provided that the following conditions are met:
68+ * Redistributions of source code must retain the above copyright
69+ notice, this list of conditions and the following disclaimer.
70+ * Redistributions in binary form must reproduce the above copyright
71+ notice, this list of conditions and the following disclaimer in the
72+ documentation and/or other materials provided with the distribution.
73+ * Neither the name of Galois Inc. nor the
74+ names of its contributors may be used to endorse or promote products
75+ derived from this software without specific prior written permission.
76+
77+THIS SOFTWARE IS PROVIDED BY Galois Inc. ``AS IS'' AND ANY
78+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
79+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
80+DISCLAIMED. IN NO EVENT SHALL Galois Inc. BE LIABLE FOR ANY
81+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
82+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
83+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
84+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
85+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
9386SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9487
9588----------------------------------------------------------------------
9689Text/XML/Light/*
90+from the xml package on HackageDB
9791(c) 2007 Galois Inc.
9892
9993All rights reserved.
pandoc.cabal+5−14
@@ -134,9 +134,6 @@ Flag executable
134134Flag library
135135 Description: Build the pandoc library.
136136 Default: True
137−Flag utf8-string
138− Description: Use utf8-string library for UTF-8 I/O.
139− Default: True
140137Flag citeproc
141138 Description: Compile in support for citeproc-hs bibliographic formatting.
142139 Default: False
@@ -149,11 +146,6 @@ Library
149146 if flag(highlighting)
150147 Build-depends: highlighting-kate
151148 cpp-options: -D_HIGHLIGHTING
152− if flag(utf8-string)
153− Build-depends: utf8-string
154− cpp-options: -D_UTF8STRING
155− else
156− Other-Modules: Text.Pandoc.UTF8
157149 if flag(citeproc)
158150 Build-depends: citeproc-hs
159151 Exposed-Modules: Text.Pandoc.Biblio
@@ -190,12 +182,16 @@ Library
190182 Text.Pandoc.Writers.S5
191183 Other-Modules: Text.Pandoc.XML,
192184 Text.Pandoc.TH,
185+ -- from xml package
193186 Text.XML.Light,
194187 Text.XML.Light.Types,
195188 Text.XML.Light.Output,
196189 Text.XML.Light.Input,
197190 Text.XML.Light.Proc,
198− Text.XML.Light.Cursor
191+ Text.XML.Light.Cursor,
192+ -- from utf8-string package
193+ System.IO.UTF8,
194+ Codec.Binary.UTF8.String
199195 Extensions: CPP, TemplateHaskell, FlexibleInstances
200196 Ghc-Options: -O2 -Wall -threaded
201197 Ghc-Prof-Options: -auto-all
@@ -214,11 +210,6 @@ Executable pandoc
214210
215211 if flag(highlighting)
216212 cpp-options: -D_HIGHLIGHTING
217− if flag(utf8-string)
218− Build-depends: utf8-string
219− cpp-options: -D_UTF8STRING
220− else
221− Other-Modules: Text.Pandoc.UTF8
222213 if flag(citeproc)
223214 Build-depends: citeproc-hs
224215 cpp-options: -D_CITEPROC