473,795 Members | 2,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12551

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
22068
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 example). int foo(const char* argv) { return 0; } int main(int argc, char* argv) {
2
1844
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 l1=256; long l2=250; wchar_t c1=(wchar_t)l1; wchar_t c2=(wchar_t)l2; s+=l1;
7
7123
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 without strtol or s/printf function. Thanks, whatluo.
5
35951
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
9832
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 that you use in combination with the ALT key to enter special characters into a document (e.g. ALT+0147 and ALT+0148 get you 'smart quotes'). I'm trying to figure out how (or if it's possible) to obtain the Unicode equivalent of the character...
2
5640
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 sending a image in the Ascii format using XML. ASCII is not useful for me to display the image. i need to convert it to BASE64 format... so i can go ahead and view the image. How do u convert ASCII to Base64 in C#.
5
8597
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 to a double type. it came back with 6 digits precision only. I also have this number, 1159964886109, in char*, and I need to convert it to uint64... i did a atol, it converted it to a 2147483647, which truncated 4 bytes for me...
2
10629
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 much..
0
1171
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 redirect to othee page that time the unicode char get unknow char store procedure giving an error. but if i click once again its working fine. here is the actual scring which is passing by querystring "Office Schule für Bürokommunikation" but...
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7540
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.