[Haskell-cafe] transliteration with Haskell iconv?

Eric Kow eric.kow at gmail.com
Fri Apr 9 12:40:38 EDT 2010


Hi all,

I'd like transliterate a UTF-8 text to ASCII.

With iconv(1), I would do

  iconv -f UTF-8 -t ASCII//TRANSLIT foo

I've tried using Duncan's iconv library, but it seems to give me more
question marks than iconv(1) would, which seems odd if it's the same
library underneath.

In other words, transliterating

  Aonach Mòr is a mountain in the Highlands of Scotland.
  On va boire un petit café si ça te dit.

gives me with iconv(1)

  Aonach Mor is a mountain in the Highlands of Scotland.
  On va boire un petit cafe si ca te dit.

but with my attempts at using Codec.Text.IConv and
examples/hiconv -f utf-8 -t ascii --transliterate, I get
  
  Aonach M?r is a mountain in the Highlands of Scotland.
  On va boire un petit caf? si ?a te dit.

Anybody run into this and know what to do?

Thanks!

PS. I'm on Ubuntu 9.04 if it makes any difference...

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100409/04f9ee59/attachment.bin


More information about the Haskell-Cafe mailing list