Commits

Luke Plant committed 22bc1a1

Improved comment

Comments (0)

Files changed (1)

src/Ella/Request.hs

 
 -- | Repacks bytes in a string according to an encoding
 --
--- PATH_INFO and other vars contains Haskell strings, but they contain
--- uninterpreted byte sequences instead of genuine Unicode chars.  We
--- re-pack as bytes (BS.pack discards anything > \255), and then
--- re-interpret.
+-- PATH_INFO and other vars contains Haskell Strings, but in reality these are
+-- simply the bytes obtained from the environment packed into Unicode chars one
+-- byte at a time.  We re-pack them into a ByteString (BS.pack discards anything
+-- > \255, which includes nothing in this case), and then re-interpret.
 repack :: String -> Encoding -> String
 repack str encoding = let bytes = BS.pack str
                       in (decoder encoding) bytes