UTF-8 library

Martin Norbäck d95mback@dtek.chalmers.se
08 Aug 2002 15:22:48 +0200


--=-eJpRYhTZOI9XaS90I6sb
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

tor 2002-08-08 klockan 15.12 skrev Axel Simon:
> On Thu, Aug 08, 2002 at 02:58:42PM +0200, Martin Norbck wrote:
> > There rarely should be a need to handle UTF-8 text internally in
> > Haskell, but for FFI it would be neccessary. Using locale automatically
> > there is wrong, since gtk2 uses UTF-8 always, and other interfaces uses
> > iso-8859-1 always. However, having some conversion functions could neve=
r
> > hurt, but they need not be in the FFI.
>=20
> Sure it is necessary to explicitly state what kind of conversion you want
> when you talk to your C library. So IMHO the only question that really
> remains is whether readFile, withCString and all other standard I/O=20
> function should assume UTF-8 by default or the current locale. I opt for=20
> the latter.

Since readFile and writeFile handles Strings, they must be locale
dependent.

Should they fall back to the most common 8-bit format (iso-8859-1) or
throw an excaption when encountering illegal multi-byte sequences?

Regards,

	Martin

--=20
Martin Norb=E4ck          d95mback@dtek.chalmers.se             =20
Kapplandsgatan 40       +46 (0)708 26 33 60                   =20
S-414 78  G=D6TEBORG      http://www.dtek.chalmers.se/~d95mback/
SWEDEN                  OpenPGP ID: 3FA8580B

--=-eJpRYhTZOI9XaS90I6sb
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: För information se http://www.gnupg.org/

iD8DBQA9UnCokXyAGj+oWAsRAmT7AJ9Eo5RnbXQybnD8qaEMxM/6lK7//wCffcaW
vdxKUBKUvdl4Pyz9Hy3PsAA=
=BkTi
-----END PGP SIGNATURE-----

--=-eJpRYhTZOI9XaS90I6sb--