Looking for C/C++ unicode related programming tutorial
Hello everyone,
I am looking for C/C++ unicode related programming tutorials. Here is my requirement, - To write programs for both Windows and Linux platform with unicode support; - To port program with unicode support from Windows to Linux platform. thanks in advance, George |
The reason I suggested Qt in your earlier thread was that it hides much of the complexity of Unicode. From personal experience I would avoid doing it in C/C++ and use a library.
For all thing UNICODE you can go to the official UNICODE site. |
|
Thanks graemef!
Quote:
I am not programming with GUI, so I can not use QT. The unicode official web site is very informative -- but I am going to find dedicated deucation tutorials for C/C++ programming, the web site only deals with general concepts of unicode. Do you have any good materials to recommend? regards, George |
Thanks MichaelZ
Quote:
regards, George |
Quote:
That way you can use the QString class that supports UNICODE without having to bundle all the GUI libraries with your application. The difficulty with UNICODE programming is that C++ supports wide characters but these tend to be in a different format to how UNICODE is stored on disk. So the typical process is, read it in, convert it, do something (such as display on the terminal), convert back, write to file. It really is quite messy and so I strongly urge you to look for a wrapper class that manages that all for you. As I said Qt is one solution (which maps across multiple O/S) but there are probably others out there. |
Quote:
Quote:
Michael |
Thanks you graemef!
Quote:
Regarding the C++ UNICODE support, I am not quite sure what do you mean "but these tend to be in a different format to how UNICODE is stored on disk" and the conversion operations you mentioned afterwards. Could you show me an example please? regards, George |
Hi MichaelZ,
Quote:
regards, George |
Quote:
Unfortunately, it seems that there is not a lot of info about. I have found some info here and there, just by googling. The best would be that you download it and look inside for some doc/examples. wxBase should be supported along wxGTK as it is a subpart of it. Also useful would be the wxWidgets forums and mailing lists. Here a free book about wxWidgets: http://www.phptr.com/content/images/...73816_book.pdf Best wishes, Michael |
Quote:
The reason for this it that internally to do sorts and comparisons it is easier if each character is of the same length, historically ASCII is the key encoding and so when storing these files on disk significant space can be saved if these can bas saved as single byte characters. Take a look at UTF-8 & UNICODE FAQ |
Maybe this will help a bit: http://cprogramming.com/tutorial/unicode.html
|
Thank you spark.ty!
Quote:
regards, George |
Thank you MichaelZ!
Quote:
regards, George |
Hi graemef,
Quote:
Quote:
Why disk space is saved by "be saved if these can bas saved as single byte characters"? I think some characters are stored as single byte in unicode, but there are more characters which are stored as multiple bytes in unicode. Why disk space is saved? reards, Geroge |
Quote:
The actual comparison rules are locale defined, and may mix the single byte and double byte characters. for example the character a can also come with accents - grace, acute umlaut. Different languages will have different comparison rules, for some it will bundle 'a' along with all its accented variants other locales will have all the un-accented characters followed by accented characters. So to do the comparison requires to lookup the locale defined order on a table and then convert this to a number which makes the comparison easier but to get the table in the first place requires the underlying data structure to be - well, structured - of a fixed width. I realise that in trying to condense the description I may have made it more confusing so feel free to ask further questions. graeme. |
All times are GMT -5. The time now is 11:18 AM. |