Thread: accent suport

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    7

    accent suport

    like..
    printf("Olá");
    and
    printf("Açucar");

    á and ç are not allowed..
    how i get them suport in c?

  2. #2
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    I believe that is a compiler/platform specific issue. What compiler are you using?

  3. #3
    ---
    Join Date
    May 2004
    Posts
    1,379
    If you redirect the out put to say a .txt file, it will work. But it seems like the console doesn't like those characters. I'm using WinXP.
    Code:
    #include <stdio.h>
    
    int main(void){
      FILE *fp;
      fp=fopen("tmp.txt","w");
      fprintf(fp,"Açucar");
      return 0;
    }

  4. #4
    Registered User
    Join Date
    Nov 2004
    Location
    USA
    Posts
    516
    the second character you want is 0x80 .. dont know bout the other one. i remember this one bcoz i was getting it in some program i was experimenting with.

    printf("%c".0x80);
    thats what i mean . u ll get the second character.

    by the way, i use borland 3.0 on win98.
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  5. #5
    ---
    Join Date
    May 2004
    Posts
    1,379
    >>by the way, i use borland 3.0 on win98

    cool!

  6. #6
    Registered User
    Join Date
    Nov 2004
    Location
    USA
    Posts
    516
    Quote Originally Posted by sand_man
    >>by the way, i use borland 3.0 on win98

    cool!
    just thought id specify that. lots of people use different compilers. ascii chars wil have the same value,but well, i thought id tell.
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  7. #7
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Look up the function setlocale. Your default locale is set to "C", which means 7-bit ANSCII.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to convert raw text with accent to UTF8.
    By intmail in forum Linux Programming
    Replies: 1
    Last Post: 08-09-2006, 10:47 AM
  2. Hyundai Accent.
    By adrianxw in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 12-01-2003, 02:46 PM
  3. Do you have an accent?
    By UnregdRegd in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 08-03-2003, 09:40 PM