Ticket #2426 (closed bug: wontfix)

Opened 5 years ago

Last modified 4 years ago

ghc-pkg should treat package.conf as UTF8

Reported by: igloo Owned by: simonmar
Priority: normal Milestone: 6.10.1
Component: Compiler Version: 6.8.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

ghc-pkg should treat package.conf as UTF8. According to #2389 it doesn't.

Change History

Changed 5 years ago by duncan

This is easy. Just use readUTF8File from Distribution.Simple.Utils rather than readFile in ghc-pkg. Though for reading from stdin it's slightly harder as we need to put stdin into binary mode first and then use fromUTF8.

The slightly trickier part is testing. We should at least check that invalid UTF-8 is rejected appropriately (the parsing should do that for us) and that valid multi-byte UTF-8 is round-tripped correctly. I'm not sure what to do for ghc-pkg describe when it's going to a console that isn't utf-8.

Changed 5 years ago by simonmar

  • difficulty changed from Unknown to Easy (1 hr)
  • milestone changed from 6.10 branch to 6.10.1

Changed 5 years ago by simonmar

  • owner set to simonmar

Changed 5 years ago by simonmar

  • status changed from new to closed
  • resolution set to wontfix

We're not going to do this: after discussing this with Duncan it was decided that we should be using the locale encoding for the input file to 'ghc-pkg register' (also stdin), which will happen when we've implemented locale encodings in the I/O library.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.