Can a TextEncoding be converted to a String?

Tag: text , unicode , haskell , locale Author: buding09 Date: 2010-09-22

It is possible to convert a string to a TextEncoding using

mkTextEncoding :: String -> IO TextEncoding

Is there any way to do do the reverse? Or, given a TextEncoding, any way to find out any information about that encoding? There doesn't even seem to be an Eq instance for TextEncoding to allow comparing against the defined encodings in System.IO.

Am I missing something, or is there a technical reason why this should not be possible?

Best Answer

TextEncoding will be a member of the Show class in GHC 7.0.1. See ticket #4273.