Where is my extended wide character ?

This is a discussion on Where is my extended wide character ? within the C Programming forums, part of the General Programming Boards category; Hello, I am writing here because I can no wprintf() the BOX DRAWING SET character under Linux. When I specify ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    20

    Where is my extended wide character ?

    Hello,

    I am writing here because I can no wprintf() the BOX DRAWING SET character under Linux.

    When I specify character number arround U+0x2500 I obtain a "+" character as box corner ; not a real corner. As horizontal line I get "-" (minus) instead of full line. My drawn line contains blank not full line.

    I have set many times the "setfont" command but no effect.

    Some times I can obtain character set by typing ALT+number but this number is far away of BOX DRAWING SET range according to the UNICODE table then I have not port this number inside my code.

    My code look like this:

    #include <wide char>
    #include <stdio>
    #include <locale>

    wchar_t t;

    t= arround 0x2500;
    wprintf(L"%lc\n", t);


    Thank you.
    Last edited by intmail; 02-12-2006 at 08:57 AM.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,047
    When I specify character number arround U+0x2500 I obtain a "+" character as box corner ; not a real corner. As horizontal line I get "-" (minus) instead of full line.
    You can't get those characters under Linux, at least I don't think you can.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    20
    >You can't get those characters under Linux, at least I don't think you can.

    It is possible. ncruses library draw correctly corner and line.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,047
    That's true.

    Why don't you redirect the output of an ncurses program into a file and see what the code for the character you want is?

    Or you could print all the possible characters and look through the output for the one you want.

    Or maybe ncurses changes the screen mode of the font somehow.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    I answered a part of this question in the Linux forum.

    You need to learn the difference between character sets and fonts. If the font you're using doesn't have a glyph for a given character, the system will try to represent the character using glyphs that it has that have (to whoever built the tables) as close a visual meaning or representation to the desired character.

    In general, on these boards at least, you should not post the same question in multiple places. It makes some people quite angry.
    Insert obnoxious but pithy remark here

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  3. Remove character from string
    By nooksooncau in forum C Programming
    Replies: 11
    Last Post: 06-05-2006, 09:37 AM
  4. about wide character and multiple byte character
    By George2 in forum C Programming
    Replies: 3
    Last Post: 05-22-2006, 08:11 PM
  5. Character handling help
    By vandalay in forum C Programming
    Replies: 18
    Last Post: 03-29-2004, 04:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21