extended ascii character in unix - Unix

This is a discussion on extended ascii character in unix - Unix ; how to print extended ascii character in unix ??...

+ Reply to Thread
Results 1 to 5 of 5

Thread: extended ascii character in unix

  1. extended ascii character in unix

    how to print extended ascii character in unix ??

  2. Re: extended ascii character in unix

    asit wrote:
    > how to print extended ascii character in unix ??


    'extended ascii' is a bad idea, as it implies codepages and all that crap.
    Rather, switch your terminal/locale to UTF-8 and then output UTF-8 -encoded
    Unicode.

    Uli


  3. Re: extended ascii character in unix

    Ulrich Eckhardt writes:
    > asit wrote:
    >> how to print extended ascii character in unix ??

    >
    > 'extended ascii' is a bad idea, as it implies codepages and all that
    > crap.


    'codepages' are something which exists on DOS/Windows. At least for
    common European languages, ISO-standards for encoding all characters
    as single bytes do exist and using them for task that can be
    accomplished this way is not a bad idea, because 'existing software'
    has better support for ISO-8859-n than for any of the bastard schemes
    random people in the US have come up to ensure in US-English texts, a
    character will always equal one byte, while multi-byte sequences have
    to be used for anything beyond that, no matter if it would be
    technically necessary or if international standards specifying
    something else do exist.

    One of the nasty implications of this is that it has become basically
    impossible to use standard UNIX(*) text processing tasks for anything
    except English texts written with the US character set at just about
    the time when (finally) most of these problems had gone away.

  4. Re: extended ascii character in unix

    asit writes:
    > how to print extended ascii character in unix ??


    It could be possible that your terminal (emulator) is configured to
    strip the eight bit off characters on input (=> termios(4), ISTRIP).

  5. Re: extended ascii character in unix

    asit wrote:
    # how to print extended ascii character in unix ??

    Which extended ASCII set? There are so many to choose from.

    In C, if you have your character codes and all of them fit
    inside a char, then you just print with fputc, fputs,
    fprintf(...%c...%s...), etc. In some languages the character
    is a 16 bit Unicode already.

    If you want to convert one extended character set to a different
    one, you'll need to use various command lines, libraries, etc
    depending on what you're programming in: the answer for C is
    different than the answer for Tcl.

    If your characters don't fit in a char (like 16 bit Unicode),
    you're going to have a hard time since the average Unix kernel
    and utilities are not designed to cope with characters don't
    fit in a char. You would probably be expected to use something
    like UTF-8 in interfaces.

    --
    SM Ryan http://www.rawbw.com/~wyrmwif/
    Wow. A sailboat.

+ Reply to Thread