[Haskell-cafe] Core packages and locale support
Felipe Lessa
felipe.lessa at gmail.com
Sat Jun 26 20:58:58 EDT 2010
On Sun, Jun 27, 2010 at 02:55:33AM +0300, Roman Beslik wrote:
> On 26.06.10 15:44, Felipe Lessa wrote:
> >However, suppose your program needs to create a file with a name
> >based on a database information. Your database is UTF-8. How do
> >you translate that UTF-8 data into a filepath? This is the
> >problem we got in Haskell. We have a nice coding-agnostic String
> >datatype, but we don't know how to create a file with this very
> >name.
>
> It is simple — you recode from (database | "network server" | file)
> encoding to the current locale.
Recoding is indeed very simple. You know the source coding
(e.g. your database is in UTF-8). But how do you discover the
target coding? How can you find out that this system uses
ISO8859-1, while this other one uses UTF-16, while...?
See the problem now? :)
Cheers,
--
Felipe.
More information about the Haskell-Cafe
mailing list