Connecting Tech Pros Worldwide Forums | Help | Site Map

Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)?

Aneesh E Warrier
Guest
 
Posts: n/a
#1: Dec 5 '06

How can I convert Unicode Codepoint (dec) value to ASCII char?

For example: 49324 is 사 a Korean alphabet, and I want to convert it
to ASCII letter.

Thanks!


Aneesh E Warrier
Guest
 
Posts: n/a
#2: Dec 5 '06

re: Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)?



Aneesh E Warrier wrote:
Quote:
How can I convert Unicode Codepoint (dec) value to ASCII char?
>
For example: 49324 is 사 a Korean alphabet, and I want to convert it
to ASCII letter.

Thanks!
TvN
Guest
 
Posts: n/a
#3: Dec 5 '06

re: Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)?



Aneesh E Warrier wrote:
Quote:
How can I convert Unicode Codepoint (dec) value to ASCII char?
>
For example: 49324 is 사 a Korean alphabet, and I want to convert it
to ASCII letter.
>
Take a look at iconv. man 3 iconv under Linux ;)

Regards,
Volodymyr!

Aneesh E Warrier
Guest
 
Posts: n/a
#4: Dec 5 '06

re: Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)?


------Take a look at iconv. man 3 iconv under Linux ;) -----

iconv converts a character string, my input is only Unicode Codepoint
(dec) for one character say 49324.

is there any way to get the Unicode character associated with the
Codepoint.

Thanks,
Aneesh

Michiel.Salters@tomtom.com
Guest
 
Posts: n/a
#5: Dec 5 '06

re: Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)?


Aneesh E Warrier schreef:
Quote:
How can I convert Unicode Codepoint (dec) value to ASCII char?
Not really a C++ problem, I guess. Basically, wrting any C++ program
requires
two steps. What does it need to do, and how do you do that in C++?
Quote:
For example: 49324 is 사 a Korean alphabet, and I want to convert it
to ASCII letter.
Ok - how would you do it without a computer? In this case, the answer
is easy.
You can't. ASCII was designed for Americans, and they don't need Korean
characters, so there is no ASCII number assigned. So you'd replace it
with
a '?'. Ok, now you should be able to figure out how to write the C++
for that -
please show us and we'll help you from there.

Michiel

Aneesh E Warrier
Guest
 
Posts: n/a
#6: Dec 5 '06

re: Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)?


I want to convert the number 49324 to its Unicode equivalent char (사)


I want something like following:

< char out =
someFunc(49324); >

Is there any way to get the char value of that Codepoint(dec)?

Thanks,
Aneesh

Michiel.Salters@tomtom.com
Guest
 
Posts: n/a
#7: Dec 5 '06

re: Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)?


Aneesh E Warrier schreef:
Quote:
I want to convert the number 49324 to its Unicode equivalent char (사)
In C++, the number IS the char. e.g. if char is ASCII, then char(65) ==
'A'
And again, assuming char is ASCII, there is no char(49324). There may
be
a wchar_t(49324), e.g. if wchar_t is Unicode. That's independent from
whether
char is ASCII. C++ implementations differ, so check your manual.

HTH,
Michiel Salters

Closed Thread