Re: [Xmonad] Non-English letters in XPrompt?

On Sat, Sep 08, 2007 at 09:51:29AM -0400, Xiao-Yong Jin wrote:
I'm using `en_US.UTF-8'. And it's a utf8 font.
Ok, I'm getting there. Almost ready to send a few patches. I think that the only viable approach is the one suggested by Mats: the use of locale technology. This requires importing with the FFI: 1. setlocale() 2. X(mb/wc)DrawImageString 3. X(mb/wc)TextEscapement then a few functions included in Mats patches: 1. XwcDrawString and XwcTextExtents 2. XCreateFontSet, XFreeFontSet, and the FontSet structure. I need to have some directions from Dons and Spencer here, since this requires some additions to X11-extras. But still there's that setlocaole stuff. If I included it in XPrompt, XPrompt.hs becomes XPrompt.hsc and must be inclued in xmonad.cabal for ghc to process it with hsc2hs. I don't know... I still have some problems in dealing properly with directory/file names when they contain non ascii characters, though. I can display them correctly but they are seen, on the Haskell side, as multiple single byte characters, so "length" returns wrong numbers. Andrea

On Wed, Sep 12, 2007 at 12:29:30PM +0200, Andrea Rossato wrote:
I think that the only viable approach is the one suggested by Mats: the use of locale technology. This requires importing with the FFI: [...]
well, it's not quite over: we must also fall back to the present way of printing strings when setlocale returns "", "C" or other stuff from which we can deduce the user did not set the LANG environmental variable... It's a bit messy but that will force me to clean up the XPrompt code (with a clearer separation of pure/IO stuff and possibly some more QuickCheck properties, as Dons's recent publications suggest...;-) I think it is worth the effort: after all it seems to me that a (properly working) prompt is a nice extension. Andrea
participants (1)
-
Andrea Rossato