Subject: Re: Problems with libedit and international characters
To: Chris Wilson <chris@qwirx.com>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-users
Date: 09/23/2007 12:43:50
On Sep 23, 4:44pm, chris@qwirx.com (Chris Wilson) wrote:
-- Subject: Re: Problems with libedit and international characters
| > Yes, it will have a problem with UTF-8 and multi-byte character sets. It
| > is not too diffcutly to fix though. I have not bothered because there is
| > not enough demand. If you want to do it though, you can look at the tcsh
| > code (where the editline code was created from) and copy the changes.
|
| Perhaps that code could be factored out of tcsh so that we don't have
| outdated copies of it lying around? And tcsh could use libedit?
That was the plan that never materialized :-) Unfortunately never found
the time to do it (and tcsh has a lot of nasty hooks in the edit code).
| Anyway I'm less scared of the libedit source code than I was, so now I
| won't be afraid to hack at it if/when this bug bites my backside :-) But
| right now I'm not sure I know what to do, unless it's trivial to copy out
| of tcsh. (I'd need a library or function for utf-8 reading/writing, I
| guess, and I don't know what that would be).
man mbrtowc... and look how tcsh handles input... It is not that hard to
do.
| > You need to call setlocale(); this works:
|
| You're absolutely right, now it works on glibc too, my bad!
|
| If this is required to use editline, then perhaps it could be documented
| somewhere and added to the fileman example?
I guess I can add it to the example but calling setlocale() is required by
all programs that want to use localization, not just ones that use editline.
christos