- Subject: Re: [slang-users] keystring conversion to non UTF-8 string?
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Fri, 18 Aug 2006 11:26:56 -0400
Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
>> 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 ^ /"?
Unfortunately, there is no "escape" mechanism for using '^' in a
key-sequence except as the last character. However, you can exploit
the algorithm to achieve the desired result. In particular, the
key-sequence ^X ^ / may be represented by the string "^X^\x9E/", since
'^' = 0x9E-'A'+1.
--John
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2006 date index]
[2006 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]