Author Topic: I need Unicode!  (Read 11689 times)

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
I need Unicode!
« on: December 08, 2006, 04:14:16 pm »
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

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: I need Unicode!
« Reply #1 on: December 08, 2006, 04:22:08 pm »
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
« Last Edit: December 08, 2006, 04:28:27 pm by joubertdj »

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
Re: I need Unicode!
« Reply #2 on: December 08, 2006, 04:29:22 pm »
I am using Code:Blocks 1.0RC2 with MINGW compiler under WinXP.
At program start-up I am selcting Create new Console Application (C)

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: I need Unicode!
« Reply #3 on: December 08, 2006, 04:30:17 pm »
 :shock:

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
Re: I need Unicode!
« Reply #4 on: December 08, 2006, 04:38:11 pm »
what's the problem?  :lol:

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: I need Unicode!
« Reply #5 on: December 08, 2006, 04:48:52 pm »
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.

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
Re: I need Unicode!
« Reply #6 on: December 08, 2006, 05:17:06 pm »
Where do I get the newer Install-Pack (already compiled for WinXP)?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: I need Unicode!
« Reply #7 on: December 08, 2006, 05:19:51 pm »
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

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: I need Unicode!
« Reply #8 on: December 08, 2006, 05:54:35 pm »
   //-- Wiki Index
       CodeBlocks Wiki Index
   //-- Wiki Main Page
    CodeBlocks Wiki Main Page

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
Re: I need Unicode!
« Reply #9 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?

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!

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: I need Unicode!
« Reply #10 on: December 08, 2006, 06:20:54 pm »
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 :))
« Last Edit: December 08, 2006, 06:23:03 pm by mispunt »
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: I need Unicode!
« Reply #11 on: December 08, 2006, 08:45:41 pm »
I'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."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: I need Unicode!
« Reply #12 on: December 08, 2006, 09:46:07 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.
« Last Edit: December 08, 2006, 09:51:45 pm by Pecan »

Offline BennM

  • Single posting newcomer
  • *
  • Posts: 9
Re: I need Unicode!
« Reply #13 on: December 10, 2006, 02:08:37 pm »
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!

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: I need Unicode!
« Reply #14 on: December 10, 2006, 02:16:38 pm »
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