Ticket #3832 (closed merge: fixed)

Opened 3 years ago

Last modified 3 years ago

openTempFile does not apply an encoding to the stream

Reported by: ross Owned by: igloo
Priority: high Milestone: 6.12.2
Component: libraries/base Version: 6.12.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

In the following program, the output is written as a raw byte, even in a UTF locale:

module Main where

import System.IO

main = do
        (_, h) <- openTempFile "." "test.txt"
        hPutStrLn h $ "\xa9" -- Copyright symbol
        hClose h

Change History

Changed 3 years ago by simonmar

  • owner set to simonmar
  • priority changed from normal to high
  • status changed from new to assigned
  • milestone set to 6.12.2

Well spotted, thanks for the report.

Changed 3 years ago by simonmar

  • owner changed from simonmar to igloo
  • status changed from assigned to new
  • type changed from bug to merge

Fixed:

Wed Jan 20 21:18:30 GMT 2010  Simon Marlow <marlowsd@gmail.com>
  * fix #3832: use the locale encoding in openTempFile
  Also while I was here fix an XXX: the Handle contained an
  uninformative string like <fd: 4> for error messages rather than the
  real file path.

Changed 3 years ago by igloo

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

Merged.

Note: See TracTickets for help on using tickets.