Unicode

X

xyz

Hell all,
I want to display a character from unicode.
for eg: "0951" is the code for the character "om" (devanagari script)
if i give the input I have to get the corresponding character

Thanks for any help
 
A

Antoninus Twink

I want to display a character from unicode.
for eg: "0951" is the code for the character "om" (devanagari script)
if i give the input I have to get the corresponding character

Make sure you #include <locale.h> and then do:

setlocale(LC_CTYPE, "");
printf("om (devanagari script) is %lc\n", 0x0951);

Of course, whether your terminal's font contains that character is
another question...
 
R

Richard Bos

xyz said:
I want to display a character from unicode.
for eg: "0951" is the code for the character "om" (devanagari script)

How to do this (and whether it is possible in the first place) depends
on your implementation, but it will probably involve use of either wide
characters (wchar_t, often direct Unicode or UTF-16) or multibyte
characters (sometimes, I don't know how often, UTF-8). See what the
manual of your implementation has to say in the sections on <wchar.h>
and <wctype.h>, and on functions like mbtowc() in <stdlib.h>.

Richard
 
K

Keith Thompson

How to do this (and whether it is possible in the first place) depends
on your implementation, but it will probably involve use of either wide
characters (wchar_t, often direct Unicode or UTF-16) or multibyte
characters (sometimes, I don't know how often, UTF-8). See what the
manual of your implementation has to say in the sections on <wchar.h>
and <wctype.h>, and on functions like mbtowc() in <stdlib.h>.

It will also depend on the capabilities of your display device.

(Incidentally, the DEVANAGARI OM character is 0950; 0951 is DEVANAGARI
STRESS SIGN UDATTA.)
 

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

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top