darcs

Issue 2571 revisit encoding when reading/writing text files

Title revisit encoding when reading/writing text files
Priority Status resolved
Milestone Resolved in
Superseder Nosy List bfrk
Assigned To
Topics

Created on 2018-03-04.18:35:13 by bfrk, last changed 2020-06-21.08:59:19 by ganesh.

Messages
msg19936 (view) Author: bfrk Date: 2018-03-04.18:35:12
Darcs.Util.Lock exports readTextFile, writeTextFile, and appendTextFile,
of which only writeTextFile explicitly sets the encoding. Either all the
functions should do this or none.

The motivation for using the fileSystemEncoding for writeTextFile is
that the content to write may not be valid unicode i.e. coming from some
external raw ByteString that may not be properly encoded according to
the user's locale. Perhaps it is enough that we override this once at
the start of the program (setDarcsEncodings). If this is the case we can
remove the line

  getFileSystemEncoding >>= hSetEncoding h

in writeTextFile.
msg22060 (view) Author: bfrk Date: 2020-06-20.10:49:06
resolved by

patch a6ffae5d728c04c188209f0838ace7ca1c5a6ddc
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Aug 25 22:06:27 CEST 2017
  * refactor text encoding in darcs
msg22067 (view) Author: ganesh Date: 2020-06-20.11:57:45
Out of interest did you deliberately open the issue several months
after writing the patch? Not a problem, just wondering about the workflow.
History
Date User Action Args
2018-03-04 18:35:13bfrkcreate
2020-06-20 10:49:09bfrksetstatus: unknown -> resolved
messages: + msg22060
2020-06-20 11:57:49ganeshsetstatus: resolved -> unknown
messages: + msg22067
2020-06-21 08:59:19ganeshsetstatus: unknown -> resolved