[slang-users] keystring conversion to non UTF-8 string?

Jörg Sommer joerg at alea.gnuu.de
Fri Aug 18 07:55:53 EDT 2006


Hello John,

"John E. Davis" <davis at space.mit.edu> wrote:
> Jörg Sommer <joerg at alea.gnuu.de> wrote:
>>int main(void)
>>{
>>    const unsigned char *raw_seq = SLang_process_keystring("^/");
> [...]
>>Is this expected? Jed does not handle this case, e.g. it prints <EF> if
>>it runs in an UTF-8 termnial.
>
> What should it print?

It should print ï.

> Strictly, speaking "^/" is not a real control character.

Ahh.

> The SLang_process_keystring converts ^X to an unsigned byte value using
> the algorithm
>
>    (unsigned char) (X - 'A' + 1)
>
> This mechanism works for valid control characters ^A-^Z as well as ^@,
> ^[, ^\, ^], ^^, and ^_.

Can you check for this range, e.g. >= '@' and <= '_'? And outside of this
range do nothing or throw an error. How else can I give the key sequence
"^X ^ /"?

> That is, it does not produce the two byte sequence <C3><AF>.  Is that
> what you were expecting?

Yes.

Bye, Jörg.
-- 
Dadurch, daß man einen anderen ins Irrenhaus sperrt,
beweist man noch nicht seinen eigenen Verstand.




More information about the slang-users-l mailing list