Questions about Unicode

A

Alex Shao

Dear all,
I have a questions about whether it is possible to use UNICODE by
Standard C++.
If not, Are there any libraries can be used to achieve it.
Any help will be appreciated.
 
V

Victor Bazarov

Alex said:
I have a questions about whether it is possible to use UNICODE by
Standard C++.
If not, Are there any libraries can be used to achieve it.

It is possible. C++ Standard makes no mention of Unicode except as
an example of encoding. Hence, no mechanism exists in C++ that is
defined to work specifically with Unicode. All is defined at the
OS level. Post your _specific_ question to the newsgroup that deals
with your OS.

V
 
V

Victor Bazarov

Alex said:
Actually I mean by Standard C++ only. Is it still possible?

Unicode is just a convention. What do you then mean by "use UNICODE"?

Can you "use" a JPEG file with Standard C++ only? Depends on what is
meant by "use", right? You can't display it. You can, however, figure
out its size and some other things that just flow out of the convention
that is JPEG.

V
 
Y

Yannick Tremblay

Actually I mean by Standard C++ only. Is it still possible?

There's nothing in the Standard C++ that stops you using UNICODE.

I would recommend you to spend some time at www.unicode.org to
understand what UNICODE is. Read the "what is unicode" entry.
Then go and read about utf8, utf16, utf32, ucs2, surrogate pairs,
etc.

Yan
 
R

Ron Natalie

Alex said:
Dear all,
I have a questions about whether it is possible to use UNICODE by
Standard C++.
If not, Are there any libraries can be used to achieve it.
Any help will be appreciated.

Standard C++ is ignorant of UNICODE. It can be implemented
but it has serious deficiencies. Look up wchar_t and related
functions and classes.
 
P

peter koch

Standard C++ is ignorant of UNICODE. It can be implemented
but it has serious deficiencies. Look up wchar_t and related
functions and classes.

Such an answer asks for more! Immediate questions are: what is it that
has serious deficiencies? C++ or Unicode? And what are those
deficiencies? And if the OP is to look up wchar_t and related
functions/classes, what does it mean that C++ is ignorant of Unicode?
Your posting looks and feels to me like FUD, but knowing you from other
posts, my belief is that I must have misunderstood something.

/Peter
 
R

Ron Natalie

peter said:
Such an answer asks for more! Immediate questions are: what is it that
has serious deficiencies? C++ or Unicode? And what are those
deficiencies? And if the OP is to look up wchar_t and related
functions/classes, what does it mean that C++ is ignorant of Unicode?
Your posting looks and feels to me like FUD, but knowing you from other
posts, my belief is that I must have misunderstood something.

C++ has char's which serve double duty as the native character type
and also as the minimum addressable unit of storage (this itself
has its own problems). It also has the concept of making up multibyte
characters (larger character encoding formed of variable numbers of
consecutive chars). The standard also provides for "wide" chars
made wchar_t types. Unfortunately a number of interfaces only have
char based arguments and no wchar_t versions. This includes file
names and the program arguments. This is a deficiency. It assumes
that there is a single known mapping form wchar_t to multibyte to
get around the problem.

C++ is ignorant of Unicode in the same way that it is ignorant of
ASCII. It has no concept of character encoding. While ASCII
is common it's not mandated. The multibyte encoding might
be UTF-8 Unicode, but it might be EUC or some one of the older
Chineese/Japanese encodings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top