Re: display unicode db text in visual C++ mfc ide 2003




My question is:
The active input locale will be in ENglish in OS-XP environment. Then my
mfc program (built in vs.2003 ide) will be running. This program will read
arabic text from database (using CDatabase/Crecordset) and will show it on
a dialog (title bar). Moreover, because of the integration to old programs,
I have to compile this program in mbcs mode. That is my problem.

Then you have a very big problem.
MBCS program running in English XP environment and showing Arabic is not
possible.

Now, this is the short story.

The long story is that you have only a few options:
- Set the system locale (the locale for non-Unicode applications) to Arabic
(but that means non-English environment in my book)
- Use Unicode in some of the UI, only where needed
This sounds nice in theory, but it tends to spread, and before you know
it, 80% of your application us Unicode. Only that you get there in a more
painfull way (bug reported, fixed, 50 times over, you are dragged to
Unicode kicking and screaming)
It can work only if your application is really clean, very modular
(which is nice on paper, but I did not see to often in real life)
- Compile the whole application as Unicode and change the interfaces with
the old programs, which I think is the right thing to do, and better
long term solution


--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
.



Relevant Pages

  • Re: scim chinese input under non GB2312 locale
    ... What I tried to find out is how to start editing Chinese on English ... IIRC on FC2/FC3 to input Chinese on English locale I have to run first; ... When I login my environment is set up as shown here: ...
    (Fedora)
  • Locales and CString::MakeUpper() and CString::CollateNoCase()
    ... I recently discovered that when running my Unicode application on an English XP system with my locales all set to English, the CString::MakeUpperfunction did not convert a Russian text string from function that does the actual conversion is _wcsupr_s. ... I eventually discovered that the conversion is dependent on the locale set using the CRT setLocalefunction. ... At this point, it looks like my only option is to find all places where we use CollateNoCase, MakeUpper(), and MakeLowerand replace them with our own functions to do these tasks. ...
    (microsoft.public.vc.mfc)
  • Re: LANG, locale, unicode, setup.py and Debian packaging
    ... strings always, independent of locale. ... A wxPython treeview control (unicode build) ... os.listdirwith a unicode path passed to it ...
    (comp.lang.python)
  • Re: UTF-8
    ... For instance, if your UTF-8 represents Chinese characters, and your locale ... Here's a bit of code that will convert between UTF-8 from a file and Unicode ...
    (microsoft.public.vb.general.discussion)
  • Re: strange effect with [:lower:] in perl
    ... > upgraded to Perl's unicode format, ... a UTF8 locale is treated ... Unicode-y operators, you can't object to Perl upgrading), and ...
    (comp.lang.perl.misc)