patch applied (cabal): Make UTF-8 decoding errors in .cabal files non-fatal

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Mar 27 11:45:29 EDT 2008


Wed Mar 26 20:17:40 PDT 2008  Duncan Coutts <duncan at haskell.org>
  * Make UTF-8 decoding errors in .cabal files non-fatal
  Previously we checked for invalid UTF-8 in the first phase of the
  parser, which splitting the file up into nested sections and fields.
  This meant the whole parser falls over if there is invalid UTF-8
  anywhere in the file. Sadly there are already packages on hackage
  with invalid UTF-8 so we would fail when parsing the hackage index.
  The solution is to move the check into the parsing of the individual
  fields and making it a warning not an error. We most typically get
  invalid UTF-8 in free text fields like author name, copyright,
  description etc so this should work out ok usually.
  We now get pretty decent error messages, like:
    Warning: hsx.cabal:5: Invalid UTF-8 text in the 'author' field.
  The warning type is now structured so that hackage will be able to
  distinguish general non-fatal warnings from UTF-8 decoding problems
  which really should be fatal errors for package uploads. 

    M ./Distribution/PackageDescription/Parse.hs -2 +8
    M ./Distribution/ParseUtils.hs -20 +19

View patch online:

  http://darcs.haskell.org/cabal/_darcs/patches/20080327031740-adfee-d022f8e7c8fbb9f0ff996a27a40399557221f980.gz



More information about the cabal-devel mailing list