[Haskell-cafe] Core packages and locale support
beroal at ukr.net
Sat Jun 26 19:55:33 EDT 2010
On 26.06.10 15:44, Felipe Lessa wrote:
> On Sat, Jun 26, 2010 at 09:29:29AM +0300, Roman Beslik wrote:
>> Incorrect encoding of filepaths is common in e.g. Cyrillic Linux
>> (because of multiple possible encodings --- CP1251, KOI8-R, UTF-8)
>> and is solved by fiddling with the current locale and media mount
>> options. No need to change a program, or to tell character encoding
>> to a program. It is not a programming language issue.
> If your program saves files using filepaths given by the user or
> created programatically from another filepath, then you don't
> need to decode/encode anything and the problem isn't in the
> programming language.
> 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
It is simple — you recode from (database | "network server" | file)
encoding to the current locale.
More information about the Haskell-Cafe