@@ -120,6 +120,11 @@ withSpinner' msg mkTrail action = do
120120 Just enc | supportUnicode enc -> coloredSpinner defaultSpinnerTheme
121121 _ -> coloredSpinner minimalSpinnerTheme
122122
123+-- | Conservatively determines whether the encoding supports Unicode.
124+--
125+-- Currently this uses a whitelist of known-to-work encodings. In principle it
126+-- could test dynamically by opening a file with this encoding, but it doesn't
127+-- look like base exposes any way to determine this in a pure fashion.
123128supportUnicode :: TextEncoding -> Bool
124129supportUnicode enc = any ((textEncodingName enc ==) . textEncodingName)
125130 [ utf8