special characters

Archived from groups: rec.games.roguelike.development (More info?)

it might have been brought up before..

i'm trying to get those special characters (borders, see attachment,
#200 for example) written on the screen using c++ and curses.. i tried
using standard alt + # in editor and when i build the console
automaticaly changes the characters to + or - or | so i can't get those
fancy single- and doublelined borders.. i managed to get them in borland
delphi using the SetConsoleOutputCP function (the one provided from
microsoft for console support).. the same function can be used in c++
but as told i get the symbols simplified.. i'm using CP 437.. anyone
knows how could i get these with c++?


thanx


vooood
21 answers Last reply
More about special characters
  1. Archived from groups: rec.games.roguelike.development (More info?)

    vooood wrote:
    > here's the image.. forgot it in the first post

    No attachments next time, man. This is a no-binary group -- people may
    get really angry with you for that. Next time place the image somewhere
    on a server and post a link ;-)
    --
    At your service,
    Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
    "Well, the philosophy of the World of Shadows is based on most of the
    degenerate, immoral and foremost amoral philosophical beliefs of our
    world exagarated to the maximum." --Anubis
  2. Archived from groups: rec.games.roguelike.development (More info?)

    Kornel Kisielewicz wrote:
    > No attachments next time, man. This is a no-binary group -- people may
    > get really angry with you for that. Next time place the image somewhere
    > on a server and post a link ;-)

    There's no attachment in the post you're replying to. At least, none I
    can see.

    --
    http://www.crisispapers.org/Editorials/germany-1933.htm
    Reichstag fire -> 9/11
    Communist "arsonist" -> Iraq "weapons of mass destruction"
    Be afraid. Be very afraid.
  3. Archived from groups: rec.games.roguelike.development (More info?)

    Kornel Kisielewicz wrote:
    > vooood wrote:
    >
    >> here's the image.. forgot it in the first post
    >
    >
    > No attachments next time, man. This is a no-binary group -- people may
    > get really angry with you for that. Next time place the image somewhere
    > on a server and post a link ;-)


    sorry.. i was really pissed :D btw.. i solwed the problem.. is there a
    faq or smthing for the group?


    vooood
  4. Archived from groups: rec.games.roguelike.development (More info?)

    vooood wrote:
    > it might have been brought up before..
    >
    > i'm trying to get those special characters (borders, see attachment,
    > #200 for example) written on the screen using c++ and curses.. i tried
    > using standard alt + # in editor and when i build the console
    > automaticaly changes the characters to + or - or | so i can't get those
    > fancy single- and doublelined borders.. i managed to get them in borland
    > delphi using the SetConsoleOutputCP function (the one provided from
    > microsoft for console support).. the same function can be used in c++
    > but as told i get the symbols simplified.. i'm using CP 437.. anyone
    > knows how could i get these with c++?

    problem solved.. there is an issue in the editor that automatically
    converts these border characters to simplier ones (and does not show the
    change until the file is reopened).. i bypassed this using hexadecimal
    codes.. eg 0xBD for that double line that looks like the equals char
    (=).. you also *have* to set to CP 437.. and as far as i'm aware every
    windows system has it by default..


    vooood
  5. Archived from groups: rec.games.roguelike.development (More info?)

    vooood wrote:
    > Kornel Kisielewicz wrote:
    >
    >> vooood wrote:
    >>
    >>> here's the image.. forgot it in the first post
    >>
    >>
    >>
    >> No attachments next time, man. This is a no-binary group -- people may
    >> get really angry with you for that. Next time place the image
    >> somewhere on a server and post a link ;-)
    >
    > sorry.. i was really pissed :D btw.. i solwed the problem.. is there a
    > faq or smthing for the group?

    There are two even ;-).
    The first one, which could be considered a general Roguelike Development
    FAQ you can find at
    http://www.roguelikedevelopment.org/development/FAQ.php

    The other one, more group related, is seen
    here:http://angband.oook.cz/rgrd.php?showpost=54676

    --
    At your service,
    Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
    "Come on, Kornel. 11 years and no binary? And it's not
    vapourware?" -- Mike Blackney
  6. Archived from groups: rec.games.roguelike.development (More info?)

    On Fri, 06 May 2005 15:36:12 +0200, vooood wrote:
    > vooood wrote:
    >> it might have been brought up before..
    >>
    >> i'm trying to get those special characters (borders, see attachment,
    >> #200 for example) written on the screen using c++ and curses.. i tried
    <cut>
    > change until the file is reopened).. i bypassed this using hexadecimal
    > codes.. eg 0xBD for that double line that looks like the equals char
    > (=).. you also *have* to set to CP 437.. and as far as i'm aware every
    > windows system has it by default..


    To be more portable, you could use the ACS_* macros instead.
    For example to draw a box:
    mvaddch(y, x, ACS_ULCORNER); /* top-left */
    mvhline(y, x + 1, ACS_HLINE, width - 2); /* top */
    mvaddch(y, x + width - 1, ACS_URCORNER); /* top-right */
    mvvline(y + 1, x, ACS_VLINE, height - 2); /* left */
    mvvline(y + 1, x + width - 1, ACS_VLINE, height - 2); /* right */
    mvaddch(y + height - 1, x, ACS_LLCORNER); /* bottom-left */
    mvhline(y + height - 1, x + 1, ACS_HLINE, width - 2); /* bottom */
    mvaddch(y + height - 1, x + width - 1, ACS_LRCORNER); /* bottom-right */


    Regards,

    --
    joni
  7. Archived from groups: rec.games.roguelike.development (More info?)

    Steve Yrjana wrote:
    > To be more portable, you could use the ACS_* macros instead.
    > For example to draw a box:
    > mvaddch(y, x, ACS_ULCORNER); /* top-left */
    > mvhline(y, x + 1, ACS_HLINE, width - 2); /* top */
    > mvaddch(y, x + width - 1, ACS_URCORNER); /* top-right */
    > mvvline(y + 1, x, ACS_VLINE, height - 2); /* left */
    > mvvline(y + 1, x + width - 1, ACS_VLINE, height - 2); /* right */
    > mvaddch(y + height - 1, x, ACS_LLCORNER); /* bottom-left */
    > mvhline(y + height - 1, x + 1, ACS_HLINE, width - 2); /* bottom */
    > mvaddch(y + height - 1, x + width - 1, ACS_LRCORNER); /* bottom-right */
    >
    >
    > Regards,
    >

    thanks.. where could i find more info on this?


    vooood
  8. Archived from groups: rec.games.roguelike.development (More info?)

    vooood <vooood@ihatespamgmail.com> wrote:
    > thanks.. where could i find more info on this?

    The ncurses howto, for all of your ncurses how to needs:

    http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
    http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/misc.html#ACSVARS

    --
    Jim Strathmeyer
  9. Archived from groups: rec.games.roguelike.development (More info?)

    Jim Strathmeyer wrote:
    > vooood <vooood@ihatespamgmail.com> wrote:
    >
    >>thanks.. where could i find more info on this?
    >
    >
    > The ncurses howto, for all of your ncurses how to needs:
    >
    > http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
    > http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/misc.html#ACSVARS
    >

    i still have one question regardint to curses.. if using built-in
    windows funcion WriteConsoleOutput i can get those nice smiley faces
    with ascii numbers 1 and 2.. when using them in curses the first 32
    (0-31) are some ^x characters.. can i bypass this somehow or something?

    thanx


    vooood
  10. Archived from groups: rec.games.roguelike.development (More info?)

    Dnia Sat, 07 May 2005 14:37:55 +0200,
    vooood napisal(a):

    > i still have one question regardint to curses.. if using built-in
    > windows funcion WriteConsoleOutput i can get those nice smiley faces
    > with ascii numbers 1 and 2.. when using them in curses the first 32
    > (0-31) are some ^x characters.. can i bypass this somehow or something?

    No. Those are control characters, they have no appearance defined in ASCII
    and other standards, displaying them on the terminal should trigger
    certain behavior, not make them appear on the screen.

    --
    Radomir @**@_ Bee! .**._ .**._ .**._ .**._ zZ
    `The Sheep' ('') 3 (..) 3 (..) 3 (..) 3 (--) 3
    Dopieralski .vvVvVVVVVvVVVvVVVvVvVVvVvvVvVVVVVVvvVVvvVvvvvVVvVVvv.v.
  11. Archived from groups: rec.games.roguelike.development (More info?)

    The Sheep wrote:
    > No. Those are control characters, they have no appearance defined in ASCII
    > and other standards, displaying them on the terminal should trigger
    > certain behavior, not make them appear on the screen.
    >

    err.. depends.. i said i can get them written using ms libs.. want a
    screenshot?


    vooood
  12. Archived from groups: rec.games.roguelike.development (More info?)

    Dnia Sat, 07 May 2005 17:37:00 +0200,
    vooood napisal(a):

    > The Sheep wrote:
    >> No. Those are control characters, they have no appearance defined in ASCII
    >> and other standards, displaying them on the terminal should trigger
    >> certain behavior, not make them appear on the screen.
    > err.. depends.. i said i can get them written using ms libs.. want a
    > screenshot?

    Note the words 'defined', 'standard' and 'should' used. ;)

    You can do it only because your libs talk directly to the graphics card
    (or it's emulation, in case of windowed mode), most likely by writting
    directly to video memory. This is only possible on the platforms that
    has such possibilities.

    It's rather impossible to get those characters displayed in a WYSE
    terminal, or using rs-232, telnet, etc.
    And because curses is designed to support those text 'terminals', the
    control characters will act as control characters.

    As a reward, your apps will work even on IBM mainframe, which has totally
    weird character set. :)

    --
    Radomir @**@_ Bee! .**._ .**._ .**._ .**._ zZ
    `The Sheep' ('') 3 (..) 3 (..) 3 (..) 3 (--) 3
    Dopieralski .vvVvVVVVVvVVVvVVVvVvVVvVvvVvVVVVVVvvVVvvVvvvvVVvVVvv.v.
  13. Archived from groups: rec.games.roguelike.development (More info?)

    Twisted One <twisted0n3@gmail.invalid> wrote:
    > Kornel Kisielewicz wrote:
    >> No attachments next time, man. This is a no-binary group --
    >> people may get really angry with you for that. Next time place
    >> the image somewhere on a server and post a link ;-)
    >
    > There's no attachment in the post you're replying to. At least,
    > none I can see.

    It was probably filtered out by your news server. Which is another
    reason to post links instead of attachments: because many servers
    do that in non-binary groups.

    --
    CalcRogue: TI-89, TI-92+, PalmOS, Windows and Linux.
    http://calcrogue.jimrandomh.org/
  14. Archived from groups: rec.games.roguelike.development (More info?)

    I've been working on incorporating unicode into Angband (it's easy
    enough for terrain). It will be the default system in my own RL. You
    can write utf8 with n/curses. But that requires your users to have utf8
    compatible terminals or displays. The other way is to use wide
    characters, but those are rarely supported except in Java.

    Ncurses prodives the ACS_ variables, but those are deprecated,
    nevermind issues of portability. Use utf8 or wide characters or none at
    all. Utf8 is well supported for terminal needs, virtually every
    "current" terminal emulator does (including, notably, the Linux
    console).

    However you will run into a problem with utf-8 because each character
    is represented by multiple bytes. This will cause alignment problems if
    your terminal structure is modeled to store one char byte per grid
    cell. You could store the characters as wide characters, then translate
    to utf-8 as needed.

    This isn't a fun nor easy issue to deal with, I recommend staying away
    from special characters if you're just tacking them on as an
    afterthought. As a stopgap measure, you could use the ACS_ characters,
    but those are _not_ guaranteed to render correctly. They don't show up
    on several terminals I've tried, which is the original reason I began
    my efforts.

    For some background, check this out:
    http://wiki.t-o-m-e.net/IdeaArchive_2fUnicodeSupport

    - Leon
  15. Archived from groups: rec.games.roguelike.development (More info?)

    On Sun, 08 May 2005 18:14:35 -0700, Leon Torres wrote:
    > Ncurses prodives the ACS_ variables, but those are deprecated,

    Interesting, would you care to tell where that is "officially" noted? I
    couldn't find that information with a quick googling and grepping through
    ncurses 5.4 source.


    > afterthought. As a stopgap measure, you could use the ACS_ characters,
    > but those are _not_ guaranteed to render correctly. They don't show up
    > on several terminals I've tried, which is the original reason I began
    > my efforts.

    In those terminals that doesn't display ACS_ characters "correctly", did
    you get the needed line drawing characters using UTF8? That is, did using
    UTF8 actually fix the problem?
    What were those terminals that didn't show them up? I guess you mean they
    were shown with "-|+" -characters when you say "does not show up", right?

    Sorry for so many questions =)


    Regards,

    --
    joni
  16. Archived from groups: rec.games.roguelike.development (More info?)

    The Sheep <sheep@atos.wmid.amu.edu.pl> wrote:
    > Dnia Sat, 07 May 2005 14:37:55 +0200,
    > vooood napisal(a):

    >> i still have one question regardint to curses.. if using built-in
    >> windows funcion WriteConsoleOutput i can get those nice smiley faces
    >> with ascii numbers 1 and 2.. when using them in curses the first 32
    >> (0-31) are some ^x characters.. can i bypass this somehow or something?

    > No. Those are control characters, they have no appearance defined in ASCII
    > and other standards, displaying them on the terminal should trigger
    > certain behavior, not make them appear on the screen.

    It depends - there's an example (test/blue.c) in ncurses which can demonstrate
    this. The only terminal that I've seen which can support it is Linux console.

    The current version of ncurses is 5.4 (20040208)
    There's an faq at
    http://invisible-island.net/ncurses/ncurses.faq.html

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net
  17. Archived from groups: rec.games.roguelike.development (More info?)

    Leon Torres <Fando.Angband@gmail.com> wrote:
    > I've been working on incorporating unicode into Angband (it's easy
    > enough for terrain). It will be the default system in my own RL. You
    > can write utf8 with n/curses. But that requires your users to have utf8
    > compatible terminals or displays. The other way is to use wide
    > characters, but those are rarely supported except in Java.

    > Ncurses prodives the ACS_ variables, but those are deprecated,

    I doubt that (no point in arguing since this posting is so far from reality).

    The current version of ncurses is 5.4 (20040208)
    There's an faq at
    http://invisible-island.net/ncurses/ncurses.faq.html

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net
  18. Archived from groups: rec.games.roguelike.development (More info?)

    Steve Yrjana wrote:
    > On Sun, 08 May 2005 18:14:35 -0700, Leon Torres wrote:
    > > Ncurses prodives the ACS_ variables, but those are deprecated,
    >
    > Interesting, would you care to tell where that is "officially" noted?


    It was on the ncurses mailing list IIRC. There was also probably a note
    in the ncurses.h file. Ncurses documenatation is really sparse and hard
    to parse, but to summarize there is a push to support wchar and utf8
    unicode in ncurses. That's what ncurses 5 (-lncursesw) is about.
    However, things are currently in flux, so either one stays with the
    older implementation or uses the newer one.


    > In those terminals that doesn't display ACS_ characters "correctly",
    did
    > you get the needed line drawing characters using UTF8? That is, did
    using
    > UTF8 actually fix the problem?

    Yes. There seems to be some problems using ACS in utf8 mode, which may
    be the source of my problems. There's also an issue with assumptions in
    the gcu code in Angband, which I tinker with, and library semantic
    confusion due to the ncurses upgrade.

    > What were those terminals that didn't show them up? I guess you mean
    they
    > were shown with "-|+" -characters when you say "does not show up",
    right?

    No, they were garbled or just didn't show up. I didn't intend to give a
    full exposition of the issues I encountered, just some advice about
    using unicode without researching thoroughly.

    >
    > Sorry for so many questions =)
    > Regards,
    >
    > --
    > joni

    NP, but I won't be able to answer more questions, which I'll address in
    a reply to the next poster.

    - Leon
  19. Archived from groups: rec.games.roguelike.development (More info?)

    Thomas Dickey wrote:
    > I doubt that (no point in arguing since this posting is so far from
    reality).
    >
    > The current version of ncurses is 5.4 (20040208)

    Whoops, might've been wrong about the deprecation, I got that info from
    some mailing list where the author must've assumed deprecation. I
    noticed the wide versions of the ACS constants, so they're here to
    stay. It would help to know what else you feel is incorrect, so I may
    be informed. The FAQ doesn't shed much more info, nor does your
    drive-by post. I know you post on the ncurses list, but I still don't
    know who you are nor do I have the time to worry bout it. It helps not
    to be so vague, introduce yourself.

    To be specific, the issues I encountered _are not_ about Ncurses
    itself, but about code assumptions in Angband's gcu code and linking
    issues with multiple ncurses implementations. I'll concede that ACS_
    use is viable, unfortunately I still recommend against it because it
    puts the code in a mindset that discourages full use of unicode symbols
    that may be useful. Draw solid blocks with utf8 or whcar explicitly.
    For RL's, it's probably best to use wchar universally and let the view
    handle utf8. This has already been discussed to death in the wiki link
    I posted.

    - Leon
  20. Archived from groups: rec.games.roguelike.development (More info?)

    Leon Torres <Fando.Angband@gmail.com> wrote:

    > Steve Yrjana wrote:
    >> On Sun, 08 May 2005 18:14:35 -0700, Leon Torres wrote:
    >> > Ncurses prodives the ACS_ variables, but those are deprecated,
    >>
    >> Interesting, would you care to tell where that is "officially" noted?


    > It was on the ncurses mailing list IIRC. There was also probably a note

    not that I recall.

    > in the ncurses.h file. Ncurses documenatation is really sparse and hard
    > to parse, but to summarize there is a push to support wchar and utf8

    send a patch.

    > unicode in ncurses. That's what ncurses 5 (-lncursesw) is about.
    > However, things are currently in flux, so either one stays with the
    > older implementation or uses the newer one.

    not many people use ncurses 4 anymore.

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net
  21. Archived from groups: rec.games.roguelike.development (More info?)

    Leon Torres <Fando.Angband@gmail.com> wrote:
    > be informed. The FAQ doesn't shed much more info, nor does your
    > drive-by post. I know you post on the ncurses list, but I still don't
    > know who you are nor do I have the time to worry bout it. It helps not
    > to be so vague, introduce yourself.

    I'm the fellow who develops and maintains ncurses (as well as several other
    programs as noted on my home page ;-)

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net
Ask a new question

Read More

Video Games