User forums > Using Code::Blocks

can type unicode character in C:B?

(1/2) > >>

hakit:
can i use unicode character such as Chinese, Vietnamese.... in CB editor ?

thomas:
Short answer: No.

Slightly longer answer: In theory, it should be possible (and quite simple, too) by adjusting parameters in wxScintilla. However, I have tried so in the past and it did nothing at all.


EDIT:
If you want to experiment, the "correct" way to do it is to call wxScintilla with SetCodePage(wxSCI_CP_UTF8);. This effectively sets the "code.page" property to 65001.
However, I was unable to see any visible difference when doing this.

cyberkoa:
I have tested under both Windows & Ubuntu Linux, it seems like we can do that.

I have tested with Chinese , Spanish , Japanese and Tamil.

RC2 binary (Windows) is built with non-Unicode support , you need to compile yourself a Unicode version.

However , recently, while I am doing testing in wxSmith , I found that TinyXML seems like cannot handle Unicode well , xrc export in wxSmith CANNOT save Double Byte character properly .

takeshimiya:
What is the current state of tinyxml per se? It supports UTF8 or not?

If it does, why C::B talks to tinyxml in ascii?
If it doesn't, wouldn't be better to modify tinyxml to use wxStrings?

thomas:

--- Quote from: takeshimiya on November 08, 2005, 06:15:15 pm ---What is the current state of tinyxml per se? It supports UTF8 or not?
--- End quote ---
It has been supporting UTF-8 encoded documents for one and a half years.


--- Quote ---If it does, why C::B talks to tinyxml in ascii?
--- End quote ---
The tags used in Code::Blocks only consist of ANSI characters. All ANSI characters are UTF-8 characters, no matter how you encode your document later. Using wide strings is nowhere better, it only breaks things.


--- Quote ---If it doesn't, wouldn't be better to modify tinyxml to use wxStrings?
--- End quote ---
Extremely bad idea. Not only would that require a lot of code changes to tinyXML and thus make updating to newer versions a pain, but it would actually break the code.
wxStrings use wchar_t sized characters in Unicode builds, and tinyXML explicitely does not support anything like this (see documentation).

Navigation

[0] Message Index

[#] Next page

Go to full version