Link to home
Start Free TrialLog in
Avatar of BarryFromBoston
BarryFromBostonFlag for United States of America

asked on

porting multi-platform (windows, unix, inux) c++ application to unicode

I'm looking for the best resources to assist me in scoping out a project to convert a sizable multiplatform C++ application to use unicode text.  also any information on what needs to be addressed/changed in the code to enable unicode text would also be useful.  i may initially attempt this on the windows mfc version.  i've been starting to try to compile modules with the /D_UNICODE and /DUNICODE compilation options to start to see what problems i'm going to run into but i feel the scope of the project could be quite large.  i've also been doing some reading and wonder about the value of books like Unicode Explained by Jukka Korpela ann Unicode Demystified by Richard Gillam.
Avatar of gheist
gheist
Flag of Belgium image

MFC is not portable. No need to waste time on that.
Avatar of BarryFromBoston

ASKER

What I'm talking about is an adaptation of the code to handle UNICODE text (not a platform port) .  The entire application, written in C and C++ now handles only single byte text and multi-byte text.  The MFC portion of the application only runs on Windows but there is an X based GUI that works on all platforms (Windows, Unix and Linux).  the idea will be to display text on all platforms using the UNICODE characters code numbering.
SOLUTION
Avatar of UTEK
UTEK

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks UTEK for your input and reference to the articles.  The more i learn about UNICODE the better off i will be.  What wide character operations could you do without actually compiling the code with UNICODE support.

I was still kind of hoping to hear from someone who has actually adapted an application to UNICODE completely, not just partially.  Also as my application is multi-platform i was hoping to hear from experts on the Unix/Linux side of the house (to which i also posted this question).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Now you have my interest peaked.  So i have some follow up questions.  

1. Are you trying to say that it is possible to get at text using the unicode character codes but without compiling the code with the UNICODE symbol defined?  If so can you give me an example of code that does this?  This sounds miraculous and may help me considerably.
2. You keep saying to look at the "Generic-Text Route Mapping" in the MSDN library.  Is that actually a subsection of the library somewhere?  I found sections titled "Generic-Text Routine Mappings" which i think mostly boil down to the routine declarations from tchar.h with much better descriptions.
More follow up questions:

One of my objectives with this conversion to UNICODE is to be able to have the user input characters from any language into text strings.  I had been hoping that i might be able to get my CEdit MFC-based dialog compiled for MBCS to enable this.  The more i read and think about it the more unlikely i'm thinking this will work.  So I'm thinking i may need to convert the entire MFC portion of our application to UNICODE in order to get this level of functionality.  I would still like to keep the bulk of non-GUI code from needing to know about UNICODE.

Is it possible to build just the MFC portion UNICODE and leave the rest SBCS as long as i'm cognizant of the translation that will be required?

And are there any known metrics about how long one could expect such an endeavor to take - based on something like lines of code or KB of code?

Thanks.
You can have Unicode capable UI and convert transparently for unaware backend - but imagine e.g cyrillic languages where backend will get equal input from different unicode strings.

I wonder if MIME-encoded ANSI strings can be produced from GUI. But then again - they will be hard to understand on old GUIs...
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial