-- This should get Text approximately under the byte limit, erring on the side of being
-- too aggressive.
truncateText :: Int -> Text -> Text
truncateText maxBytes s | bytelen s > maxBytes = 
      truncateText maxBytes . T.take (T.length s - d) $ s
    where d = bytelen s - maxBytes
truncateText :: Int -> Text -> Text
truncateText maxBytes s | bytelen s > maxBytes = 
      truncateText maxBytes . T.take (T.length s - d) $ s
    where d = bytelen s - maxBytes
truncateText maxBytes s | bytelen s > maxBytes = 
      truncateText maxBytes . T.take (T.length s - d) $ s
    where d = bytelen s - maxBytes