User forums > Using Code::Blocks

Why Unicode?

(1/3) > >>

kjliew:
Can someone educate me the advantage of a Unicode compliant IDE, instead of plain ASCII? Do all the build tools currently support source files in Unicode? (GCC, MSVC etc.) I am kind of confused. An major role of IDE is just managing source files and build process, which are mostly plain ASCII. We don't need Unicode compliant IDE to build Unicode applications.

thomas:

--- Quote from: kjliew on December 07, 2005, 04:02:46 pm ---We don't need Unicode compliant IDE to build Unicode applications.
--- End quote ---
How do you
a) display menus and dialogs in <random>chinese</random> without Unicode?
b) edit sources that contain character strings in <random>arabian</random> without an editor that handles Unicode?

EDIT:
You may want to go to http://sourceforge.jp/ and browse any random project's CVS tree using a non-Unicode Browser

takeshimiya:
I agree that most common code is done in ANSI. There are some tools that support files in Unicode (MSVC 2005 for example).
But anyways, you appart from the ability of writing source code, with the IDE can edit resources or plaint text files (which are commonly only in ASCII if they're written english, all other languages are better off with Unicode).

The world is towards Unicode, so I can guess in 10 years everything will be in Unicode.

But, all of that, it's not the main reason of why Code::Blocks is in Unicode.
It was made Unicode compliant because most linux distros now only distributes binary packages of wxWidgets in Unicode mode, not ASCII mode.

BTW, you can compile if you want wxWidgets in ASCII mode, so C::B will be in ASCII mode too (but fear that in some distant future... ASCII will be something of the past  :)).

takeshimiya:
BTW, I have another different questions:

Can someone enlightme on how to use STL string/wstring in my programs and switch between ASCII and UNICODE builds using only a #define statement?

How to use gettext for localization with the STL string?

Also, I don't want to use std::cout streans for printing, because it's not i10n-friendly.
So, There's something like wxString::Format() or wxString::Printf()?

Always talking of a C++ way of course (not C).

Michael:

--- Quote from: Takeshi Miya on December 07, 2005, 04:23:20 pm ---BTW, I have another different questions:

Can someone enlightme on how to use STL string/wstring in my programs and switch between ASCII and UNICODE builds using only a #define statement?

--- End quote ---
May be something likes this:


--- Code: ---/////////////////////////////////////////////////////////////////////////////
// tstring. Simple typedef for native STL "string" class but uses TCHAR so
// is ASCII/Unicode independent
/////////////////////////////////////////////////////////////////////////////
#ifndef _UNICODE
// ASCII
typedef std::string tstring;
typedef std::ostringstream tstringstream;
#else
// UNICODE
typedef std::wstring tstring;
typedef std::wostringstream tstringstream;
#endif

--- End code ---

The source of the above code is here: http://www.codeguru.com/forum/archive/index.php/t-161213.html

Michael

Navigation

[0] Message Index

[#] Next page

Go to full version