News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

I need Unicode!

Started by BennM, December 08, 2006, 04:14:16 PM

Previous topic - Next topic

BennM

Hi people,

how do I set up Code:Blocks to compile in Unicode oder Ascii-Code? I need some chars like ö ü ä ß for my C-console-project!

Thx

joubertdj

#1
Okay first of... which C::B version are you currently using?
Which operating system?
Which compiler?
Which console?

EDIT: Here is a unicode tutorial: http://www.flipcode.com/articles/article_advstrings01.shtml

BennM

I am using Code:Blocks 1.0RC2 with MINGW compiler under WinXP.
At program start-up I am selcting Create new Console Application (C)

joubertdj


BennM

what's the problem?  :lol:

Der Meister

RC2 is *much* too old. You should try a recent nightly build. As far as I know they are already built as unicode version.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

BennM

Where do I get the newer Install-Pack (already compiled for WinXP)?

David Perfors

See the Nightly Build forum (or use the search button :P)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Pecan

   //-- Wiki Index
       CodeBlocks Wiki Index
   //-- Wiki Main Page
    CodeBlocks Wiki Main Page

BennM

I've installed the latest version of the nighty builds!
I'm a student, so I haven't enough time to read the whole wiki-article. Could you please tell me how to setup my compiler to interprete ascii or unicode?

At the University we are using code:blocks, but there are a lot of people who don't know more than how to start the computer and run Code:Blocks!!! So the way has to be easy - I have to tell them how it works!

David Perfors

#10
To get those Unicode chars working, you have to use wchar_t instead of char or std::wstring instead of std::string. There are a lot functions where you should use the w (==wide) variant. (I guess that is the problem and not the version of C::B)

When you are using Windows apps, you need to define UNICODE (or something like that) For more information you could better use CodeProject as guide. (and since when students don't have time to read?? :P I am a student to, but I have plenty of time :))
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

thomas

Quote from: BennM on December 08, 2006, 06:12:00 PMI'm a student, so I haven't enough time to read the whole wiki-article.
You have to be joking... if students don't have time, then who has...?

Besides, there is nothing you need to do for IDE and compiler to use Unicode. The compiler uses UTF-8 as default encoding, and the nightly builds are Unicode by default, too.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Pecan

#12
Quote from: BennM on December 08, 2006, 06:12:00 PM
I've installed the latest version of the nighty builds!
I'm a student, so I haven't enough time to read the whole wiki-article. Could you please tell me how to setup my compiler to interprete ascii or unicode?

Students should read and do their own homework.

Wish I had Wiki's and Google when I was a student.

We had to haul around books back then, with much less information..
Had to spend hours waiting in line to get to the library catalog drawers. And if it wasn't indexed, more hours in the stacks searching, turning pages, failing, searching some more. Yuck. Thank god the world has changed.

BennM

Codeblocks is "only" a tool for me to do my work - if I had to read a lot of pages for every tool I need, I wouldn't be able to do all my exercises. I study Mechatronik (Mechanical engineering, electro-technology and computer science ) - it's very heavy. A software has to run after installing - no one who needs a tool likes to configure it in many hours, just to compile a few programs! I like this Code:blocks project and the idea of open-source, but it's not very easy to get a working program in short time!

David Perfors

It is easy to get a program working when you read the instructions in the wiki ;) But I agree, a program should work out of the box, or with a minimal amount of configuration
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring