Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Why printf() does not care of my locale settings ?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jens Thoms Toerring, post: 3891960"] This isn't related to C but to the program that shows the output of your C program. If you tell printf() to output the character 0x9A then it will output this character (redirect the output to a file and you will find it in that file if you look at it e.g. with a hex editor). The important question is how the program that actually shows the character interprets it - and that's unrelated to any settings within your C program. So you have to set up the program that shows the output (on Unix e.g. xterm, I don't know what's normally used under Windows) to interpret the character according to the code page you want. No, that's a misconception. Setting the locale has some influ- ence on how printf() outputs things (e.g. if it will use a decimal dot or a comma when outputting floating point numbers etc.) but it can't change anything about the interpretation of its output by a different program, the program that makes the output from your C program appear on your screen. Regards, Jens [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Why printf() does not care of my locale settings ?
Top