473,394 Members | 1,717 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,394 software developers and data experts.

Unicode to characters

KK
Hello all,
There could be flavors of this question discussed in the past, but I
could not really make a head/tail out of it.

I have bunch of unicode values stored in a string array and I want to
see the corresponding characters displayed in an excel file. How could
I go about doing that ?

vector<stringunicodevalues; // has values 0041, 0042, ... 0410 etc.
(hexa decimal values)
for 0041 (assumes hex) I should see alphabet 'A' , a 'B' for 0042 ...
special character corresponding to 0x410.

I could live with a comma separated .csv file instead of a .xls to
view it in excel.

Please advice.

Oct 6 '08 #1
2 3583
KK <pe******@gmail.comwrites:
Hello all,
There could be flavors of this question discussed in the past, but I
could not really make a head/tail out of it.

I have bunch of unicode values stored in a string array and I want to
see the corresponding characters displayed in an excel file. How could
I go about doing that ?

vector<stringunicodevalues; // has values 0041, 0042, ... 0410 etc.
If you are refering to std::string, then it's a
std::basic_string<charso you only get bytes.

If, as it is most probable, your CHAR_BITS==8, then you can only store
the codes of ISO-8859-1 characters in these strings.

(hexa decimal values)
for 0041 (assumes hex) I should see alphabet 'A' , a 'B' for 0042 ...
special character corresponding to 0x410.
0x410 is not the unicode for a special character. It's the unicode for
the CYRILLIC_CAPITAL_LETTER_A.

I could live with a comma separated .csv file instead of a .xls to
view it in excel.
I would advise you to get a better understanding of characters, codes,
the STL, I/O, files. Start reading:

http://en.wikipedia.org/wiki/Unicode
http://en.wikipedia.org/wiki/Utf-8
http://www.cplusplus.com/reference/string/string/
http://www.cplusplus.com/reference/iostream/

etc...

--
__Pascal Bourguignon__
Oct 7 '08 #2
On Oct 7, 12:08 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
KK <pedag...@gmail.comwrites:
There could be flavors of this question discussed in the
past, but I could not really make a head/tail out of it.
I have bunch of unicode values stored in a string array and
I want to see the corresponding characters displayed in an
excel file. How could I go about doing that ?
vector<stringunicodevalues; // has values 0041, 0042, ... 0410 etc.
If you are refering to std::string, then it's a
std::basic_string<charso you only get bytes.
If, as it is most probable, your CHAR_BITS==8, then you can
only store the codes of ISO-8859-1 characters in these
strings.
Nonsense. I regularly use char for Unicode (UTF-8) and ISO
8859-15; in other places, other ISO 8859 codes, or JIS are also
used. Not to mention various Windows (and earlier MS-DOS) code
pages, or EBCDIC (which is still used, in 8 bit bytes, on IBM
mainframes).

Still, I don't know what he really has or wants. Some posters
seem to think that he has a textual representation of the
unicode code values, e.g. strings like "0041". Which seems
wierd to me, but who knows.
(hexa decimal values)
for 0041 (assumes hex) I should see alphabet 'A' , a 'B' for
0042 ... special character corresponding to 0x410.
0x410 is not the unicode for a special character. It's the
unicode for the CYRILLIC_CAPITAL_LETTER_A.
Well, that's a special character to me:-). I certainly don't
use it very often.
I could live with a comma separated .csv file instead of a
.xls to view it in excel.
I would advise you to get a better understanding of characters, codes,
the STL, I/O, files. Start reading:

http://en.wikipedia.org/wiki/Unicode
http://en.wikipedia.org/wiki/Utf-8
http://www.cplusplus.com/reference/string/string/
http://www.cplusplus.com/reference/iostream/
etc...
The best reference I know about these issues is "Fonts and
Encoding", by Yannis Haralambous. (I've not seen the English
translation---I hope it's better than the translations of
English into French we usually get.) And of course, he'll also
need to find out about Excel. But I'd be very surprised if it
didn't have an option for reading UTF-8, at least in CSV.
(Alternatively, he could use UTF-16LE; I think that's the native
code set under Windows.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Oct 7 '08 #3

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

Similar topics

23
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner,...
48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
4
by: Basil | last post by:
Hello. I have compiler BC Builder 6.0. I have an example: #include <strstrea.h> int main () { wchar_t ff = {' s','d ', 'f', 'g', 't'};
7
by: Michael Davis | last post by:
Hi, I've known C/C++ for years, but only ever used ascii strings. I have a client who wants to know how gcc handles unicode. I've found the functions utf8_mbtowc, utf8_mbstowcs, utf8_wctomb and...
18
by: Ger | last post by:
I have not been able to find a simple, straight forward Unicode to ASCII string conversion function in VB.Net. Is that because such a function does not exists or do I overlook it? I found...
14
by: abhi147 | last post by:
Hi , I want to convert an array of bytes like : {79,104,-37,-66,24,123,30,-26,-99,-8,80,-38,19,14,-127,-3} into Unicode character with ISO-8859-1 standard. Can anyone help me .. how should...
8
by: Preben Randhol | last post by:
Hi If I use len() on a string containing unicode letters I get the number of bytes the string uses. This means that len() can report size 6 when the unicode string only contains 3 characters...
7
by: 7stud | last post by:
Based on this example and the error: ----- u_str = u"abc\u9999" print u_str UnicodeEncodeError: 'ascii' codec can't encode character u'\u9999' in position 3: ordinal not in range(128) ------
8
by: mario | last post by:
I have checks in code, to ensure a decode/encode cycle returns the original string. Given no UnicodeErrors, are there any cases for the following not to be True? unicode(s, enc).encode(enc)...
8
by: miztaken | last post by:
Hi, I have a string with some unicode characters and when i tried to displayed it in TreeView its not displaying. I am doing like this: TreeNode tn = new TreeNode("unicodestring");...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.