473,408 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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


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!

Dec 5 '06 #1
6 12524

Aneesh E Warrier wrote:
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!
Dec 5 '06 #2
TvN

Aneesh E Warrier wrote:
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!

Dec 5 '06 #3
------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

Dec 5 '06 #4
Aneesh E Warrier schreef:
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++?
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

Dec 5 '06 #5
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

Dec 5 '06 #6
Aneesh E Warrier schreef:
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

Dec 5 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brad Moore | last post by:
Hey all, I'm getting the following compiler error from my code. I was wondering if anyone could help me understand the concept behind it (I actually did try and compile this degenerate...
2
by: jackie | last post by:
Here is my prolem: i try to output wstring with unicode value greater than 255(for each wchar_t) to a file such as test.tmp. Here is my code: wofstream outdata("test.tmp"); wstring s; long...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
5
by: Nick | last post by:
Hi, I would like to know what method can show the unicode value of string and char in C# Thanks.
15
by: Craig Wagner | last post by:
I have a situation where I have a series of character codes stored in the database. In some cases they are the ASCII value of the character, in other cases they are the > 127 character code value...
2
by: VenuGopal | last post by:
Hi Everyone, in my application i am interacting to a known server. i send a request and get a response from the server. i am using XML and HTTP here. part of the job is that the XYZ server is...
5
by: yekasi | last post by:
Hi, I have this number, 1.5283632704970307 in char*, and I need to convert it to a double type in C++ that is capable of storing that number of precisions.... I tried doing atof and storing it...
2
by: greyhoundz102 | last post by:
hi, could someone pls help me how to convert ascii to integer without using the atoi function? (ex. X44).. i want to get the numbers and convert it to integers.. pls send me the code for C. tnx so...
0
by: prasanta.bhowmik | last post by:
Hello, I have an ASP.NET application which having some text boxs. data is filling frm the database. but sometime its having some unicode char, so when i am create querystring using javascript nd...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.