aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/UTF8.hs
AgeCommit message (Collapse)Author
2025-12-11Remove obsolete comment.John MacFarlane
2024-04-25Update copyright dates to 2024.John MacFarlane
2023-07-19Deprecate decodeArg which is now a no-op.John MacFarlane
This was needed for old base versions only.
2023-01-10Update copyright years, it's 2023!Albert Krewinkel
2022-01-02Copyright notices: update for 2022Albert Krewinkel
2021-08-17Escape backslashes in haddock comments (#7505)Emily Bourke
Any literal backslash needs to be escaped: these are currently showing up as “‘r’” instead of “‘\r’”. Co-authored-by: Emily Bourke <[email protected]>
2021-02-22Text.Pandoc.UTF8: change IO functions to return Text, not String.John MacFarlane
[API change] This affects `readFile`, `getContents`, `writeFileWith`, `writeFile`, `putStrWith`, `putStr`, `putStrLnWith`, `putStrLn`. `hPutStrWith`, `hPutStr`, `hPutStrLnWith`, `hPutStrLn`, `hGetContents`. This avoids the need to uselessly create a linked list of characters when emiting output.
2021-02-07Avoid unnecessary use of NoImplicitPrelude pragma (#7089)Albert Krewinkel
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel
2020-03-13Update copyright year (#6186)Albert Krewinkel
* Update copyright year * Copyright: add notes for Lua and Jira modules
2019-03-01Remove license boilerplate.John MacFarlane
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-01-05Update copyright notices to include 2018Albert Krewinkel
2017-06-10UTF8: export fromText, fromTextLazy.John MacFarlane
2017-06-10UTF8: export toText, toTextLazy.John MacFarlane
Define toString, toStringLazy in terms of them.
2017-05-18Add `--eol` flag and writer option to control line endings.Stefan Dresselhaus
* Add `--eol=crlf|lf` CLI option. * Add `optEol` to `WriterOptions` [API change] * In `Text.Pandoc.UTF8`, add new functions parameterized on `Newline`: `writeFileWith`, `putStrWith`, `putStrLnWith`, `hPutStrWith`, `hPutStrLnWith`. [API change] * Document option in MANUAL.txt. Closes #3663. Closes #2097.
2017-05-13Update dates in copyright noticesAlbert Krewinkel
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane
2016-09-02Remove unnecessary CPP condition in UTF8Jesse Rosenthal
Base 4.4 is ghc 7.2, so we don't have to worry about getting a lower version.
2016-03-22Updated copyright dates to include 2016.1.17.0.2John MacFarlane
2015-05-05UTF8: Better handling of bare CRs in input files.John MacFarlane
Previously we just stripped them out; now we convert other line ending styles to LF line endings. Closes #2132.
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane
2014-08-12Removed unneeded CPP.John MacFarlane
2014-05-19Avoid `import Prelude hiding (catch)`.John MacFarlane
See #1309.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel
2013-08-04Remove CPP from default-extensions; add pragmas to modules as needed.John MacFarlane
2013-07-04Text.Pandoc.UTF8: Use strict bytestrings in reading.John MacFarlane
The use of lazy bytestrings seemed to cause problems using pandoc on Windows 7/8 64-bit machines. Closes #874.
2013-05-29Added CPP directives to avoid warnings.John MacFarlane
For 'import Prelude hiding (catch)'. catch is no longer in Prelude starting with base 4.6.
2013-02-08UTF8: Strip off BOM if present.John MacFarlane
Closes #743.
2013-01-06UTF8 module: Remove `\r` when reading.John MacFarlane
This should prevent problems with extra CRs on windows.
2012-09-29UTF8: Removed unneeded imports.John MacFarlane
2012-09-26UTF8: Better error message for invalid UTF8.John MacFarlane
Read bytestring and use Text's decodeUtf8 instead of using System.IO's hGetContents. This way you get a message saying "invalid UTF-8 stream" instead of "invalid byte sequence." You are also told which byte caused the problem.
2012-09-25Removed need for utf8-string package.John MacFarlane
* Depend on text. * Expose Text.Pandoc.UTF8. * Text.Pandoc.UTF8 now exports toString, fromString, toStringLazy, fromStringLazy. * These are used instead of the old utf8-string functions.
2012-09-25UTF8: use universalNewlineMode in reading.John MacFarlane
This treats both '\r\n' and '\n' as '\n' on input, no matter what platform we're running on.
2012-09-23Revert "More intelligent handling of text encodings."John MacFarlane
This reverts commit 7272735b3d413a644fd9ab01eeae8ae9cd5a925b.
2012-09-23More intelligent handling of text encodings.John MacFarlane
Previously, UTF-8 was enforced for both input and output. The new system: * For input, UTF-8 is tried first; if an error is raised, the locale encoding is tried. * For output, the locale encoding is always used.
2012-09-23Removed unneeded CPP conditional.John MacFarlane
Removed code that was conditional on base < 4.2, since now we require base >= 4.2.
2012-09-23UTF8: Export decodeArg.John MacFarlane
2012-09-23Export encodePath/decodePath from UTF8.John MacFarlane
Removed duplicate code in src/pandoc.hs.
2012-07-26Fixed whitespace errors.John MacFarlane
2012-06-25Test for base 4.4.0 instead of 4.5.0 for argument/filename encoding.John MacFarlane
2012-06-24Don't encode/decode file paths if base >= 4.5.John MacFarlane
Prior to base 4.5 (and perhaps earlier - check), filepaths and command line arguments were treated as unencoded lists of bytes, not unicode strings, so we had to work around that by encoding and decoding them. This commit adds CPP checks for base 4.5 that disable the encoding/decoding. Fixes a bug with multilingual filenames when pandoc was compiled with ghc 7.4. Closes #540.
2011-02-11UTF8: Encode filenames.John MacFarlane
(This is still needed, even with recent base.) Partially resolves Issue #286 (though now there is a new markdown2pdf problem).
2011-01-30UTF8: Use #if instead of #ifdef.John MacFarlane
2011-01-30UTF8 module: Use base 4.2 IO if available.John MacFarlane
This gives us proper line endings on windows, and some speed improvements. We fall back to the old functions if base < 4.2. hGetContents is now exported.
2010-09-10Encode filenames as UTF8.John MacFarlane
Resolves Issue #252 (pandoc doesn't properly handle unicode filenames).
2010-07-21Changed to using strict bytestrings in UTF8 module.John MacFarlane
This avoids a problem on Windows reading from stdin. Previously we'd get an error from hGetBufNonBlocking.
2010-05-06UTF8: Modified readFile and getContents to strip BOM if present.John MacFarlane
2010-05-06Added Text.Pandoc.UTF8 for portable UTF8 string IO.John MacFarlane