Generating ASCII chars
Results 1 to 5 of 5

Thread: Generating ASCII chars

  1. #1
    Join Date
    Nov 2000
    Location
    buenos aires
    Posts
    335

    Generating ASCII chars

    Could someone please explain me why -in X window- the ´Alt´ + number combination doesn´t produce the desired ASCII character?
    Every time I try to do that on a term window it only replaces the prompt and generates this:

    Code:
    (arg:xxx)
    Where xxxx is the string of numbers that I type in the numeric keypad....
    Thanks a lot.



  2. #2
    Join Date
    Mar 2000
    Location
    Elyria, Ohio - USA
    Posts
    2,075
    The key sequence you're using is not used to display a character by it's ASCII code, but rather to print n number of character c as in:

    alt+005e

    would print out eeeee.

    I thought I remembered a key sequence to do exactly what you want, but for the life of me, I couldn't remember it. However, a simple scrip called, say a2c, for ASCII to Character, could be written with the following line:

    echo -e "\x$1"

    This form takes a ASCII hex value of the desired character. If you remove the x, then it will take the octal value of that character. I'm not sure if this is what you were looking for, but hey, it's free. LOL -mk

    ------------------
    If it ain't broke, fix it till it is.
    If it ain't broke,
    Fix it till it is.

  3. #3
    Join Date
    Nov 2000
    Location
    buenos aires
    Posts
    335
    I'm afraid you lost me ;->... Or better yet, I lost you...

    No, I don't understand you, what I was trying to say is that in Window$ that other OS, if you type:

    Code:
    Alt [key press] + [number pad] 064
    You get an: "@"...
    In linux, I can do that in the command line, but once X is up I can´t, not in a Xterm, not in a Rxvt, not in Abiword...
    Do I have to change something in my xkbmap? in XF86Config?
    Thanks, and excuse me for being such a dumheit...

  4. #4
    Join Date
    Mar 2000
    Location
    Elyria, Ohio - USA
    Posts
    2,075
    I missed the point about using the keypad, instead of the numeric keys across the top of the keyboard. The behaviour I described is valid for using those keys in both the console and an xterm window. The keypad, well, that's completely different. Sorry about my mis-read.

    I am at a loss to explain the different behaviour using the keypad, though. -mk

    ------------------
    If it ain't broke, fix it till it is.
    If it ain't broke,
    Fix it till it is.

  5. #5
    Join Date
    Nov 2000
    Location
    buenos aires
    Posts
    335
    Mike, I've tried using the number keys that are above the letters... Same problem... I can't generate any god damn ASCII character this way...
    Any idea is welcomed.
    Perhaps this is related to the xbkmap that I'm using...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •