1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Try the default converter

This commit is contained in:
Timothy Clem 2017-02-09 16:18:19 -08:00
parent e92c43224e
commit c485c0ab55

View File

@ -7,7 +7,6 @@ import Data.Aeson (ToJSON)
import Data.Aeson.Encode.Pretty
import qualified Data.ByteString as B1
import qualified Data.Text.ICU.Convert as Convert
import qualified Data.Text.ICU.Detect as Detect
import Data.Record
import qualified Data.Text as T
import qualified Data.Text.IO as T
@ -124,6 +123,5 @@ readAndTranscodeFile path = do
-- | Transcode a file to a unicode source.
transcode :: B1.ByteString -> IO (Source Char)
transcode text = fromText <$> do
match <- Detect.detectCharset text
converter <- Convert.open match Nothing
converter <- Convert.open "" Nothing
pure $ Convert.toUnicode converter text